home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / WINPROGS / WINSRC20.ZIP / FRACTALS.C < prev    next >
C/C++ Source or Header  |  1990-10-05  |  100KB  |  3,151 lines

  1. /*
  2. FRACTALS.C and CALCFRAC.C actually calculate the fractal images (well,
  3. SOMEBODY had to do it!).  The modules are set up so that all logic that
  4. is independent of any fractal-specific code is in CALCFRAC.C, and the
  5. code that IS fractal-specific is in FRACTALS.C. Original author Tim Wegner,
  6. but just about ALL the authors have contributed SOME code to this routine
  7. at one time or another, or contributed to one of the many massive
  8. restructurings.
  9.  
  10. The Fractal-specific routines are divided into three categories:
  11.  
  12. 1. Routines that are called once-per-orbit to calculate the orbit
  13.    value. These have names like "XxxxFractal", and their function
  14.    pointers are stored in fractalspecific[fractype].orbit_calc. EVERY
  15.    new fractal type needs one of these. Return 0 to continue iterations,
  16.    1 if we're done. Results for integer fractals are left in 'lnew.x' and
  17.    'lnew.y', for floating point fractals in 'new.x' and 'new.y'.
  18.  
  19. 2. Routines that are called once per pixel to set various variables
  20.    prior to the orbit calculation. These have names like xxx_per_pixel
  21.    and are fairly generic - chances are one is right for your new type.
  22.    They are stored in fractalspecific[fractype].per_pixel.
  23.  
  24. 3. Routines that are called once per screen to set various variables.
  25.    These have names like XxxxSetup, and are stored in
  26.    fractalspecific[fractype].per_image.
  27.  
  28. 4. The main fractal routine. Usually this will be StandardFractal(),
  29.    but if you have written a stand-alone fractal routine independent
  30.    of the StandardFractal mechanisms, your routine name goes here,
  31.    stored in fractalspecific[fractype].calctype.per_image.
  32.  
  33. Adding a new fractal type should be simply a matter of adding an item
  34. to the 'fractalspecific' structure, writing (or re-using one of the existing)
  35. an appropriate setup, per_image, per_pixel, and orbit routines.
  36.  
  37. --------------------------------------------------------------------   */
  38.  
  39.  
  40. #include <stdio.h>
  41. #include <stdlib.h>
  42. #include <float.h>
  43. #include <limits.h>
  44. #include <string.h>
  45. #include "fractint.h"
  46. #include "mpmath.h"
  47.  
  48. #ifndef __TURBOC__
  49. #include <malloc.h>
  50. #endif
  51.  
  52. #include "fractype.h"
  53.  
  54. #define NEWTONDEGREELIMIT  100
  55.  
  56. extern struct complex  initorbit;
  57. extern struct lcomplex linitorbit;
  58. extern char useinitorbit;
  59.  
  60. extern void (*ltrig0)();
  61. extern void (*ltrig1)();
  62. extern void (*ltrig2)();
  63. extern void (*ltrig3)();
  64. extern void (*dtrig0)();
  65. extern void (*dtrig1)();
  66. extern void (*dtrig2)();
  67. extern void (*dtrig3)();
  68.  
  69. /* -------------------------------------------------------------------- */
  70. /*   The following #defines allow the complex transcendental functions    */
  71. /*   in parser.c to be used here thus avoiding duplicated code.     */
  72. /* -------------------------------------------------------------------- */
  73.  
  74. #define CMPLXmod(z)      (sqr((z).x)+sqr((z).y))
  75. #define CMPLXconj(z)    ((z).y =  -((z).y))
  76. #define LCMPLXmod(z)       (lsqr((z).x)+lsqr((z).y))
  77. #define LCMPLXconj(z)    ((z).y =  -((z).y))
  78.  
  79.  
  80. #define LCMPLXtrig0(arg,out) Arg1->l = (arg); ltrig0(); (out)=Arg1->l
  81. #define LCMPLXtrig1(arg,out) Arg1->l = (arg); ltrig1(); (out)=Arg1->l
  82. #define LCMPLXtrig2(arg,out) Arg1->l = (arg); ltrig2(); (out)=Arg1->l
  83. #define LCMPLXtrig3(arg,out) Arg1->l = (arg); ltrig3(); (out)=Arg1->l
  84.  
  85. #define  CMPLXtrig0(arg,out) Arg1->d = (arg); dtrig0(); (out)=Arg1->d
  86. #define  CMPLXtrig1(arg,out) Arg1->d = (arg); dtrig1(); (out)=Arg1->d
  87. #define  CMPLXtrig2(arg,out) Arg1->d = (arg); dtrig2(); (out)=Arg1->d
  88. #define  CMPLXtrig3(arg,out) Arg1->d = (arg); dtrig3(); (out)=Arg1->d
  89.  
  90.  
  91. #define LCMPLXsin(arg,out)   Arg1->l = (arg); lStkSin();  (out) = Arg1->l
  92. #define LCMPLXcos(arg,out)   Arg1->l = (arg); lStkCos();  (out) = Arg1->l
  93. #define LCMPLXsinh(arg,out)  Arg1->l = (arg); lStkSinh(); (out) = Arg1->l
  94. #define LCMPLXcosh(arg,out)  Arg1->l = (arg); lStkCosh(); (out) = Arg1->l
  95. #define LCMPLXlog(arg,out)   Arg1->l = (arg); lStkLog();  (out) = Arg1->l
  96. #define LCMPLXexp(arg,out)   Arg1->l = (arg); lStkExp();  (out) = Arg1->l
  97. /*
  98. #define LCMPLXsqr(arg,out)   Arg1->l = (arg); lStkSqr();  (out) = Arg1->l
  99. */
  100. #define LCMPLXsqr(arg,out)   \
  101.    (out).x = lsqr((arg).x) - lsqr((arg).y);\
  102.    (out).y = multiply((arg).x, (arg).y, bitshiftless1)
  103. #define LCMPLXsqr_old(out)     \
  104.    (out).x = ltempsqrx - ltempsqry;\
  105.    (out).y = multiply(lold.x, lold.y, bitshiftless1)
  106.  
  107. #define LCMPLXpwr(arg1,arg2,out)    Arg2->l = (arg1); Arg1->l = (arg2);\
  108.      lStkPwr(); Arg1++; Arg2++; (out) = Arg2->l
  109. #define LCMPLXmult(arg1,arg2,out)    Arg2->l = (arg1); Arg1->l = (arg2);\
  110.      lStkMul(); Arg1++; Arg2++; (out) = Arg2->l
  111. #define LCMPLXadd(arg1,arg2,out)    \
  112.     (out).x = (arg1).x + (arg2).x; (out).y = (arg1).y + (arg2).y
  113. #define LCMPLXsub(arg1,arg2,out)    \
  114.     (out).x = (arg1).x - (arg2).x; (out).y = (arg1).y - (arg2).y
  115.  
  116. #define LCMPLXtimesreal(arg,real,out)    \
  117.     (out).x = multiply((arg).x,(real),bitshift);\
  118.     (out).y = multiply((arg).y,(real),bitshift)
  119.  
  120. #define LCMPLXrecip(arg,out)    \
  121. { long denom; denom = lsqr((arg).x) + lsqr((arg).y);\
  122. if(denom==0L) overflow=1; else {(out).x = divide((arg).x,denom,bitshift);\
  123. (out).y = -divide((arg).y,denom,bitshift);}}
  124.  
  125. #define CMPLXsin(arg,out)    Arg1->d = (arg); dStkSin();  (out) = Arg1->d
  126. #define CMPLXcos(arg,out)    Arg1->d = (arg); dStkCos();  (out) = Arg1->d
  127. #define CMPLXsinh(arg,out)   Arg1->d = (arg); dStkSinh(); (out) = Arg1->d
  128. #define CMPLXcosh(arg,out)   Arg1->d = (arg); dStkCosh(); (out) = Arg1->d
  129. #define CMPLXlog(arg,out)    Arg1->d = (arg); dStkLog();  (out) = Arg1->d
  130. #define CMPLXexp(arg,out)    FPUcplxexp(&(arg), &(out))
  131. /*
  132. #define CMPLXsqr(arg,out)    Arg1->d = (arg); dStkSqr();  (out) = Arg1->d
  133. */
  134. #define CMPLXsqr(arg,out)    \
  135.    (out).x = sqr((arg).x) - sqr((arg).y);\
  136.    (out).y = ((arg).x+(arg).x) * (arg).y
  137. #define CMPLXsqr_old(out)    \
  138.    (out).x = tempsqrx - tempsqry;\
  139.    (out).y = (old.x+old.x) * old.y
  140.  
  141. #define CMPLXpwr(arg1,arg2,out)   (out)= ComplexPower((arg1), (arg2))
  142. #define CMPLXmult1(arg1,arg2,out)    Arg2->d = (arg1); Arg1->d = (arg2);\
  143.      dStkMul(); Arg1++; Arg2++; (out) = Arg2->d
  144. #define CMPLXmult(arg1,arg2,out)  \
  145.     {\
  146.        CMPLX TmP;\
  147.        TmP.x = (arg1).x*(arg2).x - (arg1).y*(arg2).y;\
  148.        TmP.y = (arg1).x*(arg2).y + (arg1).y*(arg2).x;\
  149.        (out) = TmP;\
  150.      }
  151. #define CMPLXadd(arg1,arg2,out)    \
  152.     (out).x = (arg1).x + (arg2).x; (out).y = (arg1).y + (arg2).y
  153. #define CMPLXsub(arg1,arg2,out)    \
  154.     (out).x = (arg1).x - (arg2).x; (out).y = (arg1).y - (arg2).y
  155. #define CMPLXtimesreal(arg,real,out)   \
  156.     (out).x = (arg).x*(real);\
  157.     (out).y = (arg).y*(real)
  158.  
  159. #define CMPLXrecip(arg,out)    \
  160.    { double denom; denom = sqr((arg).x) + sqr((arg).y);\
  161.      if(denom==0.0) {(out).x = 1.0e10;(out).y = 1.0e10;}else\
  162.     { (out).x =  (arg).x/denom;\
  163.      (out).y = -(arg).y/denom;}}
  164.  
  165. extern int xshift, yshift;
  166. long Exp086(long);
  167. double fmod(double,double);
  168. extern int biomorph;
  169. extern int forcesymmetry;
  170. extern int symmetry;
  171. LCMPLX lcoefficient,lold,lnew,lparm, linit,ltmp,ltmp2,lparm2;
  172. long ltempsqrx,ltempsqry;
  173. extern int decomp[];
  174. extern double param[];
  175. extern int potflag;                   /* potential enabled? */
  176. extern double f_radius,f_xcenter,f_ycenter;    /* inversion radius, center */
  177. extern double xxmin,xxmax,yymin,yymax;           /* corners */
  178. extern int overflow;
  179. extern int integerfractal;    /* TRUE if fractal uses integer math */
  180.  
  181. int maxcolor;
  182. int root, degree,basin;
  183. double floatmin,floatmax;
  184. double roverd, d1overd, threshold;
  185. CMPLX tmp2;
  186. extern CMPLX init,tmp,old,new,saved,ComplexPower();
  187. CMPLX    staticroots[16]; /* roots array for degree 16 or less */
  188. CMPLX    *roots = staticroots;
  189. struct MPC    *MPCroots;
  190. extern int color, row, col;
  191. extern int invert;
  192. extern double far *dx0, far *dy0;
  193. extern double far *dx1, far *dy1;
  194. long FgHalf;
  195.  
  196. CMPLX one;
  197. CMPLX pwr;
  198. CMPLX Coefficient;
  199.  
  200. extern void (*plot)();
  201.  
  202. extern int    colors;             /* maximum colors available */
  203. extern int    inside;             /* "inside" color to use    */
  204. extern int    outside;            /* "outside" color to use   */
  205. extern int    finattract;
  206. extern int    fractype;            /* fractal type */
  207. extern int    debugflag;            /* for debugging purposes */
  208.  
  209. extern double    param[];        /* parameters */
  210. extern long    far *lx0, far *ly0;        /* X, Y points */
  211. extern long    far *lx1, far *ly1;        /* X, Y points */
  212. extern long    delx,dely;            /* X, Y increments */
  213. extern long    delmin;             /* min(max(dx),max(dy) */
  214. extern long    ddelmin;            /* min(max(dx),max(dy) */
  215. extern long    fudge;                /* fudge factor (2**n) */
  216. extern int    bitshift;            /* bit shift for fudge */
  217. int    bitshiftless1;            /* bit shift less 1 */
  218.  
  219. #ifndef sqr
  220. #define sqr(x) ((x)*(x))
  221. #endif
  222.  
  223. #ifndef lsqr
  224. #define lsqr(x) (multiply((x),(x),bitshift))
  225. #endif
  226.  
  227. #define modulus(z)     (sqr((z).x)+sqr((z).y))
  228. #define conjugate(pz)    ((pz)->y = 0.0 - (pz)->y)
  229. #define distance(z1,z2)  (sqr((z1).x-(z2).x)+sqr((z1).y-(z2).y))
  230. #define pMPsqr(z) (pMPmul((z),(z)))
  231. #define MPdistance(z1,z2)  (pMPadd(pMPsqr(pMPsub((z1).x,(z2).x)),pMPsqr(pMPsub((z1).y,(z2).y))))
  232.  
  233. double twopi = PI*2.0;
  234. static int c_exp;
  235.  
  236.  
  237. /* These are local but I don't want to pass them as parameters */
  238. CMPLX lambda;
  239. extern double magnitude, rqlim, rqlim2;
  240. CMPLX parm,parm2;
  241. CMPLX *floatparm;
  242. LCMPLX *longparm;
  243. extern int (*calctype)();
  244. extern unsigned long lm;        /* magnitude limit (CALCMAND) */
  245.  
  246. /* -------------------------------------------------------------------- */
  247. /*        These variables are external for speed's sake only      */
  248. /* -------------------------------------------------------------------- */
  249.  
  250. double sinx,cosx,sinhx,coshx;
  251. double siny,cosy,sinhy,coshy;
  252. double tmpexp;
  253. double tempsqrx,tempsqry;
  254.  
  255. double foldxinitx,foldyinity,foldxinity,foldyinitx;
  256. long oldxinitx,oldyinity,oldxinity,oldyinitx;
  257. long longtmp;
  258. extern long lmagnitud, llimit, llimit2, l16triglim;
  259. extern periodicitycheck;
  260. extern char floatflag;
  261.  
  262. extern int StandardFractal();
  263. extern int NewtonFractal2(); /* Lee Crocker's Newton code */
  264.  
  265. /* these are in mpmath_c.c */
  266. extern int ComplexNewtonSetup(void);
  267. extern int ComplexNewton(void), ComplexBasin(void), MarksCplxMand(void);
  268. extern int MarksCplxMandperp(void);
  269.  
  270. /* these are in (I think) JB.C */
  271. extern int Std4dFractal(), JulibrotSetup(), jb_per_pixel();
  272.  
  273. /* temporary variables for trig use */
  274. long lcosx, lcoshx, lsinx, lsinhx;
  275. long lcosy, lcoshy, lsiny, lsinhy;
  276.  
  277. /*
  278. **  details of finite attractors (required for Magnet Fractals)
  279. **  (can also be used in "coloring in" the lakes of Julia types)
  280. */
  281. extern          int      attractors; /* number of finite attractors   */
  282. extern CMPLX  attr[];       /* finite attractor values (f.p) */
  283. extern LCMPLX lattr[];      /* finite attractor values (int) */
  284.  
  285. /*
  286. **  pre-calculated values for fractal types Magnet2M & Magnet2J
  287. */
  288. CMPLX    T_Cm1;          /* 3 * (floatparm - 1)            */
  289. CMPLX    T_Cm2;          /* 3 * (floatparm - 2)            */
  290. CMPLX    T_Cm1Cm2;     /* (floatparm - 1) * (floatparm - 2) */
  291.  
  292. FloatPreCalcMagnet2() /* precalculation for Magnet2 (M & J) for speed */
  293.   {
  294.     T_Cm1.x = floatparm->x - 1.0;   T_Cm1.y = floatparm->y;
  295.     T_Cm2.x = floatparm->x - 2.0;   T_Cm2.y = floatparm->y;
  296.     T_Cm1Cm2.x = (T_Cm1.x * T_Cm2.x) - (T_Cm1.y * T_Cm2.y);
  297.     T_Cm1Cm2.y = (T_Cm1.x * T_Cm2.y) + (T_Cm1.y * T_Cm2.x);
  298.     T_Cm1.x += T_Cm1.x + T_Cm1.x;   T_Cm1.y += T_Cm1.y + T_Cm1.y;
  299.     T_Cm2.x += T_Cm2.x + T_Cm2.x;   T_Cm2.y += T_Cm2.y + T_Cm2.y;
  300.   }
  301.  
  302. /* -------------------------------------------------------------------- */
  303. /*        Stand-alone routines                                            */
  304. /* -------------------------------------------------------------------- */
  305.  
  306. extern int orbit2dfloat();
  307. extern int orbit2dlong();
  308. extern int kamtorusfloatorbit();
  309. extern int kamtoruslongorbit();
  310.  
  311. /* functions defined elswhere needed for fractalspecific */
  312. extern int orbit3dfloat();
  313. extern int orbit3dlong();
  314. extern int lorenz3dlongorbit();
  315. extern int orbit3dlongsetup();
  316. extern int lorenz3dfloatorbit();
  317. extern int orbit3dfloatsetup();
  318. extern int rosslerfloatorbit();
  319. extern int rosslerlongorbit();
  320. extern int henonfloatorbit();
  321. extern int henonlongorbit();
  322. extern int pickoverfloatorbit();
  323. extern int gingerbreadfloatorbit();
  324. extern int diffusion();
  325. extern int plasma();
  326. extern int test();
  327. extern int ifs();
  328. extern int ifs3d();
  329. extern int Bifurcation(void);
  330. extern int BifurcVerhulst(void);
  331. extern int LongBifurcVerhulst(void);
  332. extern int BifurcLambda(void);
  333. extern int LongBifurcLambda(void);
  334. extern int BifurcAddSinPi(void);
  335. extern int BifurcSetSinPi(void);
  336. extern int popcorn(void);
  337.  
  338. /* -------------------------------------------------------------------- */
  339. /*        Bailout Routines Macros                                                 */
  340. /* -------------------------------------------------------------------- */
  341.  
  342. static int near floatbailout()
  343. {
  344.    tempsqrx = sqr(new.x);
  345.    tempsqry = sqr(new.y);
  346.    if((magnitude = tempsqrx + tempsqry) >= rqlim) return(1);
  347.    old = new;
  348.    return(0);
  349. }
  350.  
  351. #define LONGBAILOUT()    \
  352.    ltempsqrx = lsqr(lnew.x); ltempsqry = lsqr(lnew.y);\
  353.    lmagnitud = ltempsqrx + ltempsqry;\
  354.    if (lmagnitud >= llimit || lmagnitud < 0 || labs(lnew.x) > llimit2\
  355.      || labs(lnew.y) > llimit2 || overflow) \
  356.            { overflow=0;return(1);}\
  357.    lold = lnew;
  358.  
  359. #define FLOATTRIGBAILOUT()  \
  360.    if (fabs(old.y) >= rqlim2) return(1);
  361.  
  362. #define LONGTRIGBAILOUT()  \
  363.    if(labs(lold.y) >= llimit2 || overflow) { overflow=0;return(1);}
  364.  
  365. #define LONGXYTRIGBAILOUT()  \
  366.    if(labs(lold.x) >= llimit2 || labs(lold.y) >= llimit2 || overflow)\
  367.     { overflow=0;return(1);}
  368.  
  369. #define FLOATXYTRIGBAILOUT()  \
  370.    if (fabs(old.x) >= rqlim2 || fabs(old.y) >= rqlim2) return(1);
  371.  
  372. #define FLOATHTRIGBAILOUT()  \
  373.    if (fabs(old.x) >= rqlim2) return(1);
  374.  
  375. #define LONGHTRIGBAILOUT()  \
  376.    if(labs(lold.x) >= llimit2 || overflow) { overflow=0;return(1);}
  377.  
  378. #define TRIG16CHECK(X)    \
  379.       if(labs((X)) > l16triglim || overflow) { overflow=0;return(1);}
  380.  
  381. #define FLOATEXPBAILOUT()  \
  382.    if (fabs(old.y) >= 1.0e8) return(1);\
  383.    if (fabs(old.x) >= 6.4e2) return(1);
  384.  
  385. #define LONGEXPBAILOUT()  \
  386.    if (labs(lold.y) >= 1000L<<bitshift) return(1);\
  387.    if (labs(lold.x) >=    8L<<bitshift) return(1);
  388.  
  389. #if 0
  390. /* this define uses usual trig instead of fast trig */
  391. #define FPUsincos(px,psinx,pcosx) \
  392.    *(psinx) = sin(*(px));\
  393.    *(pcosx) = cos(*(px));
  394.  
  395. #define FPUsinhcosh(px,psinhx,pcoshx) \
  396.    *(psinhx) = sinh(*(px));\
  397.    *(pcoshx) = cosh(*(px));
  398. #endif
  399.  
  400. #define LTRIGARG(X)    \
  401.    if(labs((X)) > l16triglim)\
  402.    {\
  403.       double tmp;\
  404.       tmp = (X);\
  405.       tmp /= fudge;\
  406.       tmp = fmod(tmp,twopi);\
  407.       tmp *= fudge;\
  408.       (X) = tmp;\
  409.    }\
  410.  
  411. /* -------------------------------------------------------------------- */
  412. /*        Fractal (once per iteration) routines            */
  413. /* -------------------------------------------------------------------- */
  414. static double xt, yt, t2;
  415.  
  416. /* Raise complex number (base) to the (exp) power, storing the result
  417. ** in complex (result).
  418. */
  419. cpower(CMPLX *base, int exp, CMPLX *result)
  420. {
  421.     xt = base->x;   yt = base->y;
  422.  
  423.     if (exp & 1)
  424.     {
  425.        result->x = xt;
  426.        result->y = yt;
  427.     }
  428.     else
  429.     {
  430.        result->x = 1.0;
  431.        result->y = 0.0;
  432.     }
  433.  
  434.     exp >>= 1;
  435.     while (exp)
  436.     {
  437.     t2 = xt * xt - yt * yt;
  438.     yt = 2 * xt * yt;
  439.     xt = t2;
  440.  
  441.     if (exp & 1)
  442.     {
  443.         t2 = xt * result->x - yt * result->y;
  444.         result->y = result->y * xt + yt * result->x;
  445.         result->x = t2;
  446.     }
  447.     exp >>= 1;
  448.     }
  449. }
  450. /* long version */
  451. static long lxt, lyt, lt1, lt2;
  452. lcpower(LCMPLX *base, int exp, LCMPLX *result, int bitshift)
  453. {
  454.     static long maxarg;
  455.     maxarg = 64L<<bitshift;
  456.  
  457.     overflow = 0;
  458.     lxt = base->x;   lyt = base->y;
  459.  
  460.     if (exp & 1)
  461.     {
  462.        result->x = lxt;
  463.        result->y = lyt;
  464.     }
  465.     else
  466.     {
  467.        result->x = 1L<<bitshift;
  468.        result->y = 0L;
  469.     }
  470.  
  471.     exp >>= 1;
  472.     while (exp)
  473.     {
  474.     /*
  475.     if(labs(lxt) >= maxarg || labs(lyt) >= maxarg)
  476.        return(-1);
  477.     */
  478.     lt2 = multiply(lxt, lxt, bitshift) - multiply(lyt,lyt,bitshift);
  479.     lyt = multiply(lxt,lyt,bitshiftless1);
  480.     if(overflow)
  481.        return(overflow);
  482.     lxt = lt2;
  483.  
  484.     if (exp & 1)
  485.     {
  486.         lt2 = multiply(lxt,result->x, bitshift) - multiply(lyt,result->y,bitshift);
  487.         result->y = multiply(result->y,lxt,bitshift) + multiply(lyt,result->x,bitshift);
  488.         result->x = lt2;
  489.     }
  490.     exp >>= 1;
  491.     }
  492.     if(result->x == 0 && result->y == 0)
  493.        overflow = 1;
  494.     return(overflow);
  495. }
  496.  
  497. z_to_the_z(CMPLX *z, CMPLX *out)
  498. {
  499.     static CMPLX tmp1,tmp2;
  500.     /* raises complex z to the z power */
  501.     int errno_xxx;
  502.     errno_xxx = 0;
  503.  
  504.     if(fabs(z->x) < DBL_EPSILON) return(-1);
  505.  
  506.     /* log(x + iy) = 1/2(log(x*x + y*y) + i(arc_tan(y/x)) */
  507.     tmp1.x = .5*log(sqr(z->x)+sqr(z->y));
  508.  
  509.     /* the fabs in next line added to prevent discontinuity in image */
  510.     tmp1.y = atan(fabs(z->y/z->x));
  511.  
  512.     /* log(z)*z */
  513.     tmp2.x = tmp1.x * z->x - tmp1.y * z->y;
  514.     tmp2.y = tmp1.x * z->y + tmp1.y * z->x;
  515.  
  516.     /* z*z = e**(log(z)*z) */
  517.     /* e**(x + iy) =  e**x * (cos(y) + isin(y)) */
  518.  
  519.     tmpexp = exp(tmp2.x);
  520.  
  521.     FPUsincos(&tmp2.y,&siny,&cosy);
  522.     out->x = tmpexp*cosy;
  523.     out->y = tmpexp*siny;
  524.     return(errno_xxx);
  525. }
  526.  
  527. /* Distance of complex z from unit circle */
  528. #define DIST1(z) (((z).x-1.0)*((z).x-1.0)+((z).y)*((z).y))
  529. #define LDIST1(z) (lsqr((((z).x)-fudge)) + lsqr(((z).y)))
  530.  
  531. #ifdef NEWTON
  532. complex_mult(CMPLX arg1,CMPLX arg2,CMPLX *pz);
  533. complex_div(CMPLX arg1,CMPLX arg2,CMPLX *pz);
  534.  
  535. int NewtonFractal()
  536. {
  537.     static char start=1;
  538.     if(start)
  539.     {
  540.        printf("c version");
  541.        start = 0;
  542.     }
  543.     cpower(&old, degree-1, &tmp);
  544.     complex_mult(tmp, old, &new);
  545.  
  546.     if (DIST1(new) < threshold)
  547.     {
  548.        if(fractype==NEWTBASIN)
  549.        {
  550.       int tmpcolor;
  551.       int i;
  552.       tmpcolor = -1;
  553.       /* this code determines which degree-th root of root the
  554.          Newton formula converges to. The roots of a 1 are
  555.          distributed on a circle of radius 1 about the origin. */
  556.       for(i=0;i<degree;i++)
  557.          /* color in alternating shades with iteration according to
  558.         which root of 1 it converged to */
  559.           if(distance(roots[i],old) < threshold)
  560.           {
  561.            /*    tmpcolor = 1+(i&7)+((color&1)<<3); */
  562.            tmpcolor = 1+i;
  563.            break;
  564.           }
  565.        if(tmpcolor == -1)
  566.           color = maxcolor;
  567.        else
  568.           color = tmpcolor;
  569.        }
  570.        return(1);
  571.     }
  572.     new.x = d1overd * new.x + roverd;
  573.     new.y *= d1overd;
  574.  
  575.     /* Watch for divide underflow */
  576.     if ((t2 = tmp.x * tmp.x + tmp.y * tmp.y) < FLT_MIN)
  577.       return(1);
  578.     else
  579.     {
  580.     t2 = 1.0 / t2;
  581.     old.x = t2 * (new.x * tmp.x + new.y * tmp.y);
  582.     old.y = t2 * (new.y * tmp.x - new.x * tmp.y);
  583.     }
  584.     return(0);
  585. }
  586.  
  587.  
  588. complex_mult(arg1,arg2,pz)
  589. CMPLX arg1,arg2,*pz;
  590. {
  591.    pz->x = arg1.x*arg2.x - arg1.y*arg2.y;
  592.    pz->y = arg1.x*arg2.y+arg1.y*arg2.x;
  593.    return(0);
  594. }
  595.  
  596. complex_div(numerator,denominator,pout)
  597. CMPLX numerator,denominator,*pout;
  598. {
  599.    double mod;
  600.    if((mod = modulus(denominator)) < FLT_MIN)
  601.       return(1);
  602.    conjugate(&denominator);
  603.    complex_mult(numerator,denominator,pout);
  604.    pout->x = pout->x/mod;
  605.    pout->y = pout->y/mod;
  606.    return(0);
  607. }
  608.  
  609.  
  610. lcomplex_mult(arg1,arg2,pz,bitshift)
  611. LCMPLX arg1,arg2,*pz;
  612. int bitshift;
  613. {
  614.    overflow = 0;
  615.    pz->x = multiply(arg1.x,arg2.x,bitshift) - multiply(arg1.y,arg2.y,bitshift);
  616.    pz->y = multiply(arg1.x,arg2.y,bitshift) + multiply(arg1.y,arg2.x,bitshift);
  617.    return(overflow);
  618. }
  619.  
  620. #endif
  621.  
  622. #define MPCmod(m) (pMPadd(pMPmul((m).x, (m).x), pMPmul((m).y, (m).y)))
  623. struct MPC mpcold, mpcnew, mpctmp, mpctmp1;
  624. struct MP mproverd, mpd1overd, mpthreshold,sqrmpthreshold;
  625. struct MP mpt2;
  626. struct MP mpone;
  627. extern struct MPC MPCone;
  628. extern int MPOverflow;
  629. int MPCNewtonFractal()
  630. {
  631.     MPOverflow = 0;
  632.     mpctmp   = MPCpow(mpcold,degree-1);
  633.  
  634.     mpcnew.x = pMPsub(pMPmul(mpctmp.x,mpcold.x),pMPmul(mpctmp.y,mpcold.y));
  635.     mpcnew.y = pMPadd(pMPmul(mpctmp.x,mpcold.y),pMPmul(mpctmp.y,mpcold.x));
  636.  
  637.     mpctmp1.x = pMPsub(mpcnew.x, MPCone.x);
  638.     mpctmp1.y = pMPsub(mpcnew.y, MPCone.y);
  639.  
  640.     if(pMPcmp(MPCmod(mpctmp1),mpthreshold)< 0)
  641.     {
  642.       if(fractype==MPNEWTBASIN)
  643.       {
  644.      int tmpcolor;
  645.      int i;
  646.      tmpcolor = -1;
  647.      for(i=0;i<degree;i++)
  648.          if(pMPcmp(MPdistance(MPCroots[i],mpcold),mpthreshold) < 0)
  649.          {
  650.         if(basin==2)
  651.            tmpcolor = 1+(i&7) + ((color&1)<<3);
  652.         else
  653.            tmpcolor = 1+i;
  654.             break;
  655.          }
  656.       if(tmpcolor == -1)
  657.          color = maxcolor;
  658.       else
  659.          color = tmpcolor;
  660.       }
  661.        return(1);
  662.     }
  663.  
  664.     mpcnew.x = pMPadd(pMPmul(mpd1overd,mpcnew.x),mproverd);
  665.     mpcnew.y = pMPmul(mpcnew.y,mpd1overd);
  666.  
  667.     mpt2 = MPCmod(mpctmp);
  668.     mpt2 = pMPdiv(mpone,mpt2);
  669.  
  670.     mpcold.x = pMPmul(mpt2,(pMPadd(pMPmul(mpcnew.x,mpctmp.x),pMPmul(mpcnew.y,mpctmp.y))));
  671.     mpcold.y = pMPmul(mpt2,(pMPsub(pMPmul(mpcnew.y,mpctmp.x),pMPmul(mpcnew.x,mpctmp.y))));
  672.  
  673.     new.x = *pMP2d(mpcold.x);
  674.     new.y = *pMP2d(mpcold.y);
  675.     return(MPOverflow);
  676. }
  677.  
  678.  
  679. Barnsley1Fractal()
  680. {
  681.    /* Barnsley's Mandelbrot type M1 from "Fractals
  682.    Everywhere" by Michael Barnsley, p. 322 */
  683.  
  684.    /* calculate intermediate products */
  685.    oldxinitx   = multiply(lold.x, longparm->x, bitshift);
  686.    oldyinity   = multiply(lold.y, longparm->y, bitshift);
  687.    oldxinity   = multiply(lold.x, longparm->y, bitshift);
  688.    oldyinitx   = multiply(lold.y, longparm->x, bitshift);
  689.    /* orbit calculation */
  690.    if(lold.x >= 0)
  691.    {
  692.       lnew.x = (oldxinitx - longparm->x - oldyinity);
  693.       lnew.y = (oldyinitx - longparm->y + oldxinity);
  694.    }
  695.    else
  696.    {
  697.       lnew.x = (oldxinitx + longparm->x - oldyinity);
  698.       lnew.y = (oldyinitx + longparm->y + oldxinity);
  699.    }
  700.    LONGBAILOUT();
  701.    return(0);
  702. }
  703.  
  704. Barnsley1FPFractal()
  705. {
  706.    /* Barnsley's Mandelbrot type M1 from "Fractals
  707.    Everywhere" by Michael Barnsley, p. 322 */
  708.  
  709.    /* calculate intermediate products */
  710.    foldxinitx = old.x * floatparm->x;
  711.    foldyinity = old.y * floatparm->y;
  712.    foldxinity = old.x * floatparm->y;
  713.    foldyinitx = old.y * floatparm->x;
  714.    /* orbit calculation */
  715.    if(old.x >= 0)
  716.    {
  717.       new.x = (foldxinitx - floatparm->x - foldyinity);
  718.       new.y = (foldyinitx - floatparm->y + foldxinity);
  719.    }
  720.    else
  721.    {
  722.       new.x = (foldxinitx + floatparm->x - foldyinity);
  723.       new.y = (foldyinitx + floatparm->y + foldxinity);
  724.    }
  725.    return(floatbailout());
  726. }
  727.  
  728. Barnsley2Fractal()
  729. {
  730.    /* An unnamed Mandelbrot/Julia function from "Fractals
  731.    Everywhere" by Michael Barnsley, p. 331, example 4.2 */
  732.  
  733.    /* calculate intermediate products */
  734.    oldxinitx   = multiply(lold.x, longparm->x, bitshift);
  735.    oldyinity   = multiply(lold.y, longparm->y, bitshift);
  736.    oldxinity   = multiply(lold.x, longparm->y, bitshift);
  737.    oldyinitx   = multiply(lold.y, longparm->x, bitshift);
  738.  
  739.    /* orbit calculation */
  740.    if(oldxinity + oldyinitx >= 0)
  741.    {
  742.       lnew.x = oldxinitx - longparm->x - oldyinity;
  743.       lnew.y = oldyinitx - longparm->y + oldxinity;
  744.    }
  745.    else
  746.    {
  747.       lnew.x = oldxinitx + longparm->x - oldyinity;
  748.       lnew.y = oldyinitx + longparm->y + oldxinity;
  749.    }
  750.    LONGBAILOUT();
  751.    return(0);
  752. }
  753.  
  754. Barnsley2FPFractal()
  755. {
  756.    /* An unnamed Mandelbrot/Julia function from "Fractals
  757.    Everywhere" by Michael Barnsley, p. 331, example 4.2 */
  758.  
  759.    /* calculate intermediate products */
  760.    foldxinitx = old.x * floatparm->x;
  761.    foldyinity = old.y * floatparm->y;
  762.    foldxinity = old.x * floatparm->y;
  763.    foldyinitx = old.y * floatparm->x;
  764.  
  765.    /* orbit calculation */
  766.    if(foldxinity + foldyinitx >= 0)
  767.    {
  768.       new.x = foldxinitx - floatparm->x - foldyinity;
  769.       new.y = foldyinitx - floatparm->y + foldxinity;
  770.    }
  771.    else
  772.    {
  773.       new.x = foldxinitx + floatparm->x - foldyinity;
  774.       new.y = foldyinitx + floatparm->y + foldxinity;
  775.    }
  776.    return(floatbailout());
  777. }
  778.  
  779. JuliaFractal()
  780. {
  781.    /* used for C prototype of fast integer math routines for classic
  782.       Mandelbrot and Julia */
  783.    lnew.x  = ltempsqrx - ltempsqry + longparm->x;
  784.    lnew.y = multiply(lold.x, lold.y, bitshiftless1) + longparm->y;
  785.    LONGBAILOUT();
  786.    return(0);
  787. }
  788.  
  789. JuliafpFractal()
  790. {
  791.    /* floating point version of classical Mandelbrot/Julia */
  792.    new.x = tempsqrx - tempsqry + floatparm->x;
  793.    new.y = 2.0 * old.x * old.y + floatparm->y;
  794.    return(floatbailout());
  795. }
  796.  
  797. LambdaFPFractal()
  798. {
  799.    /* variation of classical Mandelbrot/Julia */
  800.  
  801.    tempsqrx = old.x - old.x * old.x + old.y * old.y;
  802.    tempsqry = old.y - old.y * old.x * 2;
  803.  
  804.    new.x = floatparm->x * tempsqrx - floatparm->y * tempsqry;
  805.    new.y = floatparm->x * tempsqry + floatparm->y * tempsqrx;
  806.    return(floatbailout());
  807. }
  808.  
  809. LambdaFractal()
  810. {
  811.    /* variation of classical Mandelbrot/Julia */
  812.  
  813.    /* in complex math) temp = Z * (1-Z) */
  814.    ltempsqrx = lold.x - ltempsqrx + ltempsqry;
  815.    ltempsqry = lold.y
  816.          - multiply(lold.y, lold.x, bitshiftless1);
  817.    /* (in complex math) Z = Lambda * Z */
  818.    lnew.x = multiply(longparm->x, ltempsqrx, bitshift)
  819.     - multiply(longparm->y, ltempsqry, bitshift);
  820.    lnew.y = multiply(longparm->x, ltempsqry, bitshift)
  821.     + multiply(longparm->y, ltempsqrx, bitshift);
  822.    LONGBAILOUT();
  823.    return(0);
  824. }
  825.  
  826. SierpinskiFractal()
  827. {
  828.    /* following code translated from basic - see "Fractals
  829.    Everywhere" by Michael Barnsley, p. 251, Program 7.1.1 */
  830.    lnew.x = (lold.x << 1);        /* new.x = 2 * old.x  */
  831.    lnew.y = (lold.y << 1);        /* new.y = 2 * old.y  */
  832.    if(lold.y > ltmp.y)    /* if old.y > .5 */
  833.       lnew.y = lnew.y - ltmp.x; /* new.y = 2 * old.y - 1 */
  834.    else if(lold.x > ltmp.y)    /* if old.x > .5 */
  835.       lnew.x = lnew.x - ltmp.x; /* new.x = 2 * old.x - 1 */
  836.    /* end barnsley code */
  837.    LONGBAILOUT();
  838.    return(0);
  839. }
  840.  
  841. SierpinskiFPFractal()
  842. {
  843.    /* following code translated from basic - see "Fractals
  844.    Everywhere" by Michael Barnsley, p. 251, Program 7.1.1 */
  845.  
  846.    new.x = old.x + old.x;
  847.    new.y = old.y + old.y;
  848.    if(old.y > .5)
  849.       new.y = new.y - 1;
  850.    else if (old.x > .5)
  851.       new.x = new.x - 1;
  852.  
  853.    /* end barnsley code */
  854.    return(floatbailout());
  855. }
  856.  
  857. LambdaexponentFractal()
  858. {
  859.    /* found this in  "Science of Fractal Images" */
  860.    FLOATEXPBAILOUT();
  861.    FPUsincos  (&old.y,&siny,&cosy);
  862.  
  863.    if (old.x >= rqlim && cosy >= 0.0) return(1);
  864.    tmpexp = exp(old.x);
  865.    tmp.x = tmpexp*cosy;
  866.    tmp.y = tmpexp*siny;
  867.  
  868.    /*multiply by lamda */
  869.    new.x = floatparm->x*tmp.x - floatparm->y*tmp.y;
  870.    new.y = floatparm->y*tmp.x + floatparm->x*tmp.y;
  871.    old = new;
  872.    return(0);
  873. }
  874.  
  875. LongLambdaexponentFractal()
  876. {
  877.    /* found this in  "Science of Fractal Images" */
  878.    LONGEXPBAILOUT();
  879.  
  880.    SinCos086  (lold.y, &lsiny,    &lcosy);
  881.  
  882.    if (lold.x >= llimit && lcosy >= 0L) return(1);
  883.    longtmp = Exp086(lold.x);
  884.  
  885.    ltmp.x = multiply(longtmp,       lcosy,   bitshift);
  886.    ltmp.y = multiply(longtmp,       lsiny,   bitshift);
  887.  
  888.    lnew.x  = multiply(longparm->x, ltmp.x, bitshift)
  889.        - multiply(longparm->y, ltmp.y, bitshift);
  890.    lnew.y  = multiply(longparm->x, ltmp.y, bitshift)
  891.        + multiply(longparm->y, ltmp.x, bitshift);
  892.    lold = lnew;
  893.    return(0);
  894. }
  895.  
  896. FloatTrigPlusExponentFractal()
  897. {
  898.    /* another Scientific American biomorph type */
  899.    /* z(n+1) = e**z(n) + trig(z(n)) + C */
  900.  
  901.    if (fabs(old.x) >= 6.4e2) return(1); /* DOMAIN errors */
  902.    tmpexp = exp(old.x);
  903.    FPUsincos  (&old.y,&siny,&cosy);
  904.    CMPLXtrig0(old,new);
  905.  
  906.    /*new =   trig(old) + e**old + C  */
  907.    new.x += tmpexp*cosy + floatparm->x;
  908.    new.y += tmpexp*siny + floatparm->y;
  909.    return(floatbailout());
  910. }
  911.  
  912.  
  913. LongTrigPlusExponentFractal()
  914. {
  915.    /* calculate exp(z) */
  916.  
  917.    /* domain check for fast transcendental functions */
  918.    TRIG16CHECK(lold.x);
  919.    TRIG16CHECK(lold.y);
  920.  
  921.    longtmp = Exp086(lold.x);
  922.    SinCos086  (lold.y, &lsiny,    &lcosy);
  923.    LCMPLXtrig0(lold,lnew);
  924.    lnew.x += multiply(longtmp,      lcosy,   bitshift) + longparm->x;
  925.    lnew.y += multiply(longtmp,      lsiny,   bitshift) + longparm->y;
  926.    LONGBAILOUT();
  927.    return(0);
  928. }
  929.  
  930. MarksLambdaFractal()
  931. {
  932.    /* Mark Peterson's variation of "lambda" function */
  933.  
  934.    /* Z1 = (C^(exp-1) * Z**2) + C */
  935.    ltmp.x = ltempsqrx - ltempsqry;
  936.    ltmp.y = multiply(lold.x ,lold.y ,bitshiftless1);
  937.  
  938.    lnew.x = multiply(lcoefficient.x, ltmp.x, bitshift)
  939.     - multiply(lcoefficient.y, ltmp.y, bitshift) + longparm->x;
  940.    lnew.y = multiply(lcoefficient.x, ltmp.y, bitshift)
  941.     + multiply(lcoefficient.y, ltmp.x, bitshift) + longparm->y;
  942.  
  943.    LONGBAILOUT();
  944.    return(0);
  945. }
  946.  
  947.  
  948. long XXOne, FgOne, FgTwo;
  949.  
  950. UnityFractal()
  951. {
  952.    /* brought to you by Mark Peterson - you won't find this in any fractal
  953.       books unless they saw it here first - Mark invented it! */
  954.    XXOne = multiply(lold.x, lold.x, bitshift) + multiply(lold.y, lold.y, bitshift);
  955.    if((XXOne > FgTwo) || (labs(XXOne - FgOne) < delmin))
  956.       return(1);
  957.    lold.y = multiply(FgTwo - XXOne, lold.x, bitshift);
  958.    lold.x = multiply(FgTwo - XXOne, lold.y, bitshift);
  959.    lnew=lold;  /* TW added this line */
  960.    return(0);
  961. }
  962.  
  963. #define XXOne new.x
  964.  
  965. UnityfpFractal()
  966. {
  967.    /* brought to you by Mark Peterson - you won't find this in any fractal
  968.       books unless they saw it here first - Mark invented it! */
  969.  
  970.    XXOne = sqr(old.x) + sqr(old.y);
  971.    if((XXOne > 2.0) || (fabs(XXOne - 1.0) < ddelmin))
  972.       return(1);
  973.    old.y = (2.0 - XXOne)* old.x;
  974.    old.x = (2.0 - XXOne)* old.y;
  975.    new=old;  /* TW added this line */
  976.    return(0);
  977. }
  978.  
  979. #undef XXOne
  980.  
  981. Mandel4Fractal()
  982. {
  983.    /* By writing this code, Bert has left behind the excuse "don't
  984.       know what a fractal is, just know how to make'em go fast".
  985.       Bert is hereby declared a bonafide fractal expert! Supposedly
  986.       this routine calculates the Mandelbrot/Julia set based on the
  987.       polynomial z**4 + lambda, but I wouldn't know -- can't follow
  988.       all that integer math speedup stuff - Tim */
  989.  
  990.    /* first, compute (x + iy)**2 */
  991.    lnew.x  = ltempsqrx - ltempsqry;
  992.    lnew.y = multiply(lold.x, lold.y, bitshiftless1);
  993.    LONGBAILOUT();
  994.  
  995.    /* then, compute ((x + iy)**2)**2 + lambda */
  996.    lnew.x  = ltempsqrx - ltempsqry + longparm->x;
  997.    lnew.y = multiply(lold.x, lold.y, bitshiftless1) + longparm->y;
  998.    LONGBAILOUT();
  999.    return(0);
  1000. }
  1001.  
  1002. floatZtozPluszpwrFractal()
  1003. {
  1004.    cpower(&old,(int)param[2],&new);
  1005.    old = ComplexPower(old,old);
  1006.    new.x = new.x + old.x +floatparm->x;
  1007.    new.y = new.y + old.y +floatparm->y;
  1008.    return(floatbailout());
  1009. }
  1010.  
  1011. longZpowerFractal()
  1012. {
  1013.    if(lcpower(&lold,c_exp,&lnew,bitshift))
  1014.       lnew.x = lnew.y = 8L<<bitshift;
  1015.    lnew.x += longparm->x;
  1016.    lnew.y += longparm->y;
  1017.    LONGBAILOUT();
  1018.    return(0);
  1019. }
  1020. floatZpowerFractal()
  1021. {
  1022.    cpower(&old,c_exp,&new);
  1023.    new.x += floatparm->x;
  1024.    new.y += floatparm->y;
  1025.    return(floatbailout());
  1026. }
  1027.  
  1028. Barnsley3Fractal()
  1029. {
  1030.    /* An unnamed Mandelbrot/Julia function from "Fractals
  1031.    Everywhere" by Michael Barnsley, p. 292, example 4.1 */
  1032.  
  1033.    /* calculate intermediate products */
  1034.    oldxinitx   = multiply(lold.x, lold.x, bitshift);
  1035.    oldyinity   = multiply(lold.y, lold.y, bitshift);
  1036.    oldxinity   = multiply(lold.x, lold.y, bitshift);
  1037.  
  1038.    /* orbit calculation */
  1039.    if(lold.x > 0)
  1040.    {
  1041.       lnew.x = oldxinitx   - oldyinity - fudge;
  1042.       lnew.y = oldxinity << 1;
  1043.    }
  1044.    else
  1045.    {
  1046.       lnew.x = oldxinitx - oldyinity - fudge
  1047.        + multiply(longparm->x,lold.x,bitshift);
  1048.       lnew.y = oldxinity <<1;
  1049.  
  1050.       /* This term added by Tim Wegner to make dependent on the
  1051.      imaginary part of the parameter. (Otherwise Mandelbrot
  1052.      is uninteresting. */
  1053.       lnew.y += multiply(longparm->y,lold.x,bitshift);
  1054.    }
  1055.    LONGBAILOUT();
  1056.    return(0);
  1057. }
  1058.  
  1059. Barnsley3FPFractal()
  1060. {
  1061.    /* An unnamed Mandelbrot/Julia function from "Fractals
  1062.    Everywhere" by Michael Barnsley, p. 292, example 4.1 */
  1063.  
  1064.  
  1065.    /* calculate intermediate products */
  1066.    foldxinitx  = old.x * old.x;
  1067.    foldyinity  = old.y * old.y;
  1068.    foldxinity  = old.x * old.y;
  1069.  
  1070.    /* orbit calculation */
  1071.    if(old.x > 0)
  1072.    {
  1073.       new.x = foldxinitx - foldyinity - 1.0;
  1074.       new.y = foldxinity * 2;
  1075.    }
  1076.    else
  1077.    {
  1078.       new.x = foldxinitx - foldyinity -1.0 + floatparm->x * old.x;
  1079.       new.y = foldxinity * 2;
  1080.  
  1081.       /* This term added by Tim Wegner to make dependent on the
  1082.      imaginary part of the parameter. (Otherwise Mandelbrot
  1083.      is uninteresting. */
  1084.       new.y += floatparm->y * old.x;
  1085.    }
  1086.    return(floatbailout());
  1087. }
  1088.  
  1089. TrigPlusZsquaredFractal()
  1090. {
  1091.    /* From Scientific American, July 1989 */
  1092.    /* A Biomorph              */
  1093.    /* z(n+1) = trig(z(n))+z(n)**2+C      */
  1094.    LCMPLXtrig0(lold,lnew);
  1095.    lnew.x += ltempsqrx - ltempsqry + longparm->x;
  1096.    lnew.y += multiply(lold.x, lold.y, bitshiftless1) + longparm->y;
  1097.    LONGBAILOUT();
  1098.    return(0);
  1099. }
  1100.  
  1101. TrigPlusZsquaredfpFractal()
  1102. {
  1103.    /* From Scientific American, July 1989 */
  1104.    /* A Biomorph              */
  1105.    /* z(n+1) = trig(z(n))+z(n)**2+C      */
  1106.  
  1107.    CMPLXtrig0(old,new);
  1108.    new.x += tempsqrx - tempsqry + floatparm->x;
  1109.    new.y += 2.0 * old.x * old.y + floatparm->y;
  1110.    return(floatbailout());
  1111. }
  1112.  
  1113. PopcornFractal()
  1114. {
  1115.    extern int row;
  1116.    tmp = old;
  1117.    tmp.x *= 3.0;
  1118.    tmp.y *= 3.0;
  1119.    FPUsincos(&tmp.x,&sinx,&cosx);
  1120.    FPUsincos(&tmp.y,&siny,&cosy);
  1121.    tmp.x = sinx/cosx + old.x;
  1122.    tmp.y = siny/cosy + old.y;
  1123.    FPUsincos(&tmp.x,&sinx,&cosx);
  1124.    FPUsincos(&tmp.y,&siny,&cosy);
  1125.    new.x = old.x - .05*siny;
  1126.    new.y = old.y - .05*sinx;
  1127.    /*
  1128.    new.x = old.x - .05*sin(old.y+tan(3*old.y));
  1129.    new.y = old.y - .05*sin(old.x+tan(3*old.x));
  1130.    */
  1131.    if(plot == noplot)
  1132.    {
  1133.       plot_orbit(new.x,new.y,1+row%colors);
  1134.       old = new;
  1135.    }
  1136.    else
  1137.    /* FLOATBAILOUT(); */
  1138.    /* PB The above line was weird, not what it seems to be!  But, bracketing
  1139.      it or always doing it (either of which seem more likely to be what
  1140.      was intended) changes the image for the worse, so I'm not touching it.
  1141.      Same applies to int form in next routine. */
  1142.    /* PB later: recoded inline, still leaving it weird */
  1143.       tempsqrx = sqr(new.x);
  1144.    tempsqry = sqr(new.y);
  1145.    if((magnitude = tempsqrx + tempsqry) >= rqlim) return(1);
  1146.    old = new;
  1147.    return(0);
  1148. }
  1149.  
  1150. LPopcornFractal()
  1151. {
  1152.    static long O5 = (long)(.05*(1L<<16));
  1153.    extern int row;
  1154.    ltmp = lold;
  1155.    ltmp.x *= 3L;
  1156.    ltmp.y *= 3L;
  1157.    LTRIGARG(ltmp.x);
  1158.    LTRIGARG(ltmp.y);
  1159.    SinCos086(ltmp.x,&lsinx,&lcosx);
  1160.    SinCos086(ltmp.y,&lsiny,&lcosy);
  1161.    ltmp.x = divide(lsinx,lcosx,bitshift) + lold.x;
  1162.    ltmp.y = divide(lsiny,lcosy,bitshift) + lold.y;
  1163.    LTRIGARG(ltmp.x);
  1164.    LTRIGARG(ltmp.y);
  1165.    SinCos086(ltmp.x,&lsinx,&lcosx);
  1166.    SinCos086(ltmp.y,&lsiny,&lcosy);
  1167.    lnew.x = lold.x - multiply(O5,lsiny,bitshift);
  1168.    lnew.y = lold.y - multiply(O5,lsinx,bitshift);
  1169.    if(plot == noplot)
  1170.    {
  1171.       iplot_orbit(lnew.x,lnew.y,1+row%colors);
  1172.       lold = lnew;
  1173.    }
  1174.    else
  1175.       LONGBAILOUT();
  1176.    return(0);
  1177. }
  1178.  
  1179. int MarksCplxMand(void)
  1180. {
  1181.    tmp.x = tempsqrx - tempsqry;
  1182.    tmp.y = 2*old.x*old.y;
  1183.    FPUcplxmul(&tmp, &Coefficient, &new);
  1184.    new.x += floatparm->x;
  1185.    new.y += floatparm->y;
  1186.    return(floatbailout());
  1187. }
  1188.  
  1189. int SpiderfpFractal(void)
  1190. {
  1191.    /* Spider(XAXIS) { c=z=pixel: z=z*z+c; c=c/2+z, |z|<=4 } */
  1192.    new.x = tempsqrx - tempsqry + tmp.x;
  1193.    new.y = 2 * old.x * old.y + tmp.y;
  1194.    tmp.x = tmp.x/2 + new.x;
  1195.    tmp.y = tmp.y/2 + new.y;
  1196.    return(floatbailout());
  1197. }
  1198.  
  1199. SpiderFractal(void)
  1200. {
  1201.    /* Spider(XAXIS) { c=z=pixel: z=z*z+c; c=c/2+z, |z|<=4 } */
  1202.    lnew.x  = ltempsqrx - ltempsqry + ltmp.x;
  1203.    lnew.y = multiply(lold.x, lold.y, bitshiftless1) + ltmp.y;
  1204.    ltmp.x = (ltmp.x >> 1) + lnew.x;
  1205.    ltmp.y = (ltmp.y >> 1) + lnew.y;
  1206.    LONGBAILOUT();
  1207.    return(0);
  1208. }
  1209.  
  1210. TetratefpFractal()
  1211. {
  1212.    /* Tetrate(XAXIS) { c=z=pixel: z=c^z, |z|<=(P1+3) } */
  1213.    new = ComplexPower(*floatparm,old);
  1214.    return(floatbailout());
  1215. }
  1216.  
  1217. ZXTrigPlusZFractal()
  1218. {
  1219.    /* z = (p1*z*trig(z))+p2*z */
  1220.    LCMPLXtrig0(lold,ltmp);        /* ltmp  = trig(old)         */
  1221.    LCMPLXmult(lparm,ltmp,ltmp);      /* ltmp  = p1*trig(old)          */
  1222.    LCMPLXmult(lold,ltmp,ltmp2);      /* ltmp2 = p1*old*trig(old)      */
  1223.    LCMPLXmult(lparm2,lold,ltmp);     /* ltmp  = p2*old              */
  1224.    LCMPLXadd(ltmp2,ltmp,lnew);         /* lnew  = p1*trig(old) + p2*old */
  1225.    LONGBAILOUT();
  1226.    return(0);
  1227. }
  1228.  
  1229. ScottZXTrigPlusZFractal()
  1230. {
  1231.    /* z = (z*trig(z))+z */
  1232.    LCMPLXtrig0(lold,ltmp);        /* ltmp  = trig(old)       */
  1233.    LCMPLXmult(lold,ltmp,lnew);         /* lnew  = old*trig(old)    */
  1234.    LCMPLXadd(lnew,lold,lnew);         /* lnew  = trig(old) + old */
  1235.    LONGBAILOUT();
  1236.    return(0);
  1237. }
  1238.  
  1239. SkinnerZXTrigSubZFractal()
  1240. {
  1241.    /* z = (z*trig(z))-z */
  1242.    LCMPLXtrig0(lold,ltmp);        /* ltmp  = trig(old)       */
  1243.    LCMPLXmult(lold,ltmp,lnew);         /* lnew  = old*trig(old)    */
  1244.    LCMPLXsub(lnew,lold,lnew);         /* lnew  = trig(old) - old */
  1245.    LONGBAILOUT();
  1246.    return(0);
  1247. }
  1248.  
  1249. ZXTrigPlusZfpFractal()
  1250. {
  1251.    /* z = (p1*z*trig(z))+p2*z */
  1252.    CMPLXtrig0(old,tmp);      /* tmp  = trig(old)         */
  1253.    CMPLXmult(parm,tmp,tmp);     /* tmp  = p1*trig(old)      */
  1254.    CMPLXmult(old,tmp,tmp2);     /* tmp2 = p1*old*trig(old)     */
  1255.    CMPLXmult(parm2,old,tmp);     /* tmp  = p2*old         */
  1256.    CMPLXadd(tmp2,tmp,new);     /* new  = p1*trig(old) + p2*old */
  1257.    return(floatbailout());
  1258. }
  1259.  
  1260. ScottZXTrigPlusZfpFractal()
  1261. {
  1262.    /* z = (z*trig(z))+z */
  1263.    CMPLXtrig0(old,tmp);     /* tmp    = trig(old)      */
  1264.    CMPLXmult(old,tmp,new);     /* new  = old*trig(old)   */
  1265.    CMPLXadd(new,old,new);     /* new  = trig(old) + old */
  1266.    return(floatbailout());
  1267. }
  1268.  
  1269. SkinnerZXTrigSubZfpFractal()
  1270. {
  1271.    /* z = (z*trig(z))-z */
  1272.    CMPLXtrig0(old,tmp);     /* tmp    = trig(old)      */
  1273.    CMPLXmult(old,tmp,new);     /* new  = old*trig(old)   */
  1274.    CMPLXsub(new,old,new);     /* new  = trig(old) - old */
  1275.    return(floatbailout());
  1276. }
  1277.  
  1278. Sqr1overTrigFractal()
  1279. {
  1280.    /* z = sqr(1/trig(z)) */
  1281.    LCMPLXtrig0(lold,lold);
  1282.    LCMPLXrecip(lold,lold);
  1283.    LCMPLXsqr(lold,lnew);
  1284.    LONGBAILOUT();
  1285.    return(0);
  1286. }
  1287.  
  1288. Sqr1overTrigfpFractal()
  1289. {
  1290.    /* z = sqr(1/trig(z)) */
  1291.    CMPLXtrig0(old,old);
  1292.    CMPLXrecip(old,old);
  1293.    CMPLXsqr(old,new);
  1294.    return(floatbailout());
  1295. }
  1296.  
  1297. TrigPlusTrigFractal()
  1298. {
  1299.    /* z = trig(0,z)*p1+trig1(z)*p2 */
  1300.    LCMPLXtrig0(lold,ltmp);
  1301.    LCMPLXmult(lparm,ltmp,ltmp);
  1302.    LCMPLXtrig1(lold,ltmp2);
  1303.    LCMPLXmult(lparm2,ltmp2,lold);
  1304.    LCMPLXadd(ltmp,lold,lnew);
  1305.    LONGBAILOUT();
  1306.    return(0);
  1307. }
  1308.  
  1309. TrigPlusTrigfpFractal()
  1310. {
  1311.    /* z = trig0(z)*p1+trig1(z)*p2 */
  1312.    CMPLXtrig0(old,tmp);
  1313.    CMPLXmult(parm,tmp,tmp);
  1314.    CMPLXtrig1(old,old);
  1315.    CMPLXmult(parm2,old,old);
  1316.    CMPLXadd(tmp,old,new);
  1317.    return(floatbailout());
  1318. }
  1319.  
  1320.  
  1321. ScottTrigPlusTrigFractal()
  1322. {
  1323.    /* z = trig0(z)+trig1(z) */
  1324.    LCMPLXtrig0(lold,ltmp);
  1325.    LCMPLXtrig1(lold,lold);
  1326.    LCMPLXadd(ltmp,lold,lnew);
  1327.    LONGBAILOUT();
  1328.    return(0);
  1329. }
  1330.  
  1331. ScottTrigPlusTrigfpFractal()
  1332. {
  1333.    /* z = trig0(z)+trig1(z) */
  1334.    CMPLXtrig0(old,tmp);
  1335.    CMPLXtrig1(old,tmp2);
  1336.    CMPLXadd(tmp,tmp2,new);
  1337.    return(floatbailout());
  1338. }
  1339.  
  1340. SkinnerTrigSubTrigFractal()
  1341. {
  1342.    /* z = trig(0,z)-trig1(z) */
  1343.    LCMPLXtrig0(lold,ltmp);
  1344.    LCMPLXtrig1(lold,ltmp2);
  1345.    LCMPLXsub(ltmp,ltmp2,lnew);
  1346.    LONGBAILOUT();
  1347.    return(0);
  1348. }
  1349.  
  1350. SkinnerTrigSubTrigfpFractal()
  1351. {
  1352.    /* z = trig0(z)-trig1(z) */
  1353.    CMPLXtrig0(old,tmp);
  1354.    CMPLXtrig1(old,tmp2);
  1355.    CMPLXsub(tmp,tmp2,new);
  1356.    return(floatbailout());
  1357. }
  1358.  
  1359.  
  1360. TrigXTrigfpFractal()
  1361. {
  1362.    /* z = trig0(z)*trig1(z) */
  1363.    CMPLXtrig0(old,tmp);
  1364.    CMPLXtrig1(old,old);
  1365.    CMPLXmult(tmp,old,new);
  1366.    return(floatbailout());
  1367. }
  1368.  
  1369. TrigXTrigFractal()
  1370. {
  1371.    LCMPLX ltmp2;
  1372.    /* z = trig0(z)*trig1(z) */
  1373.    LCMPLXtrig0(lold,ltmp);
  1374.    LCMPLXtrig1(lold,ltmp2);
  1375.    LCMPLXmult(ltmp,ltmp2,lnew);
  1376.    if(overflow)
  1377.       TryFloatFractal(TrigXTrigfpFractal);
  1378.    LONGBAILOUT();
  1379.    return(0);
  1380. }
  1381.  
  1382.  /* call float version of fractal if integer math overflow */
  1383. TryFloatFractal(int (*fpFractal)())
  1384. {
  1385.    overflow=0;
  1386.    /* lold had better not be changed! */
  1387.    old.x = lold.x; old.x /= fudge;
  1388.    old.y = lold.y; old.y /= fudge;
  1389.    tempsqrx = sqr(old.x);
  1390.    tempsqry = sqr(old.y);
  1391.    fpFractal();
  1392.    lnew.x = new.x/fudge;
  1393.    lnew.y = new.y/fudge;
  1394.    return(0);
  1395. }
  1396.  
  1397. /********************************************************************/
  1398. /*  Next six orbit functions are one type - extra functions are     */
  1399. /*    special cases written for speed.                    */
  1400. /********************************************************************/
  1401.  
  1402. TrigPlusSqrFractal() /* generalization of Scott and Skinner types */
  1403. {
  1404.    /* { z=pixel: z=(p1,p2)*trig(z)+(p3,p4)*sqr(z), |z|<BAILOUT } */
  1405.    LCMPLXtrig0(lold,ltmp);     /* ltmp = trig(lold)               */
  1406.    LCMPLXmult(lparm,ltmp,lnew); /* lnew = lparm*trig(lold)            */
  1407.    LCMPLXsqr_old(ltmp);     /* ltmp = sqr(lold)                */
  1408.    LCMPLXmult(lparm2,ltmp,ltmp);/* ltmp = lparm2*sqr(lold)            */
  1409.    LCMPLXadd(lnew,ltmp,lnew);    /* lnew = lparm*trig(lold)+lparm2*sqr(lold) */
  1410.    LONGBAILOUT();
  1411.    return(0);
  1412. }
  1413.  
  1414. TrigPlusSqrfpFractal() /* generalization of Scott and Skinner types */
  1415. {
  1416.    /* { z=pixel: z=(p1,p2)*trig(z)+(p3,p4)*sqr(z), |z|<BAILOUT } */
  1417.    CMPLXtrig0(old,tmp);     /* tmp = trig(old)               */
  1418.    CMPLXmult(parm,tmp,new); /* new = parm*trig(old)           */
  1419.    CMPLXsqr_old(tmp);         /* tmp = sqr(old)                */
  1420.    CMPLXmult(parm2,tmp,tmp2); /* tmp = parm2*sqr(old)             */
  1421.    CMPLXadd(new,tmp2,new);    /* new = parm*trig(old)+parm2*sqr(old) */
  1422.    return(floatbailout());
  1423. }
  1424.  
  1425. ScottTrigPlusSqrFractal()
  1426. {
  1427.    /*  { z=pixel: z=trig(z)+sqr(z), |z|<BAILOUT } */
  1428.    LCMPLXtrig0(lold,lnew);    /* lnew = trig(lold)         */
  1429.    LCMPLXsqr_old(ltmp);        /* lold = sqr(lold)          */
  1430.    LCMPLXadd(ltmp,lnew,lnew);  /* lnew = trig(lold)+sqr(lold) */
  1431.    LONGBAILOUT();
  1432.    return(0);
  1433. }
  1434.  
  1435. ScottTrigPlusSqrfpFractal() /* float version */
  1436. {
  1437.    /* { z=pixel: z=sin(z)+sqr(z), |z|<BAILOUT } */
  1438.    CMPLXtrig0(old,new);       /* new = trig(old)      */
  1439.    CMPLXsqr_old(tmp);           /* tmp = sqr(old)       */
  1440.    CMPLXadd(new,tmp,new);      /* new = trig(old)+sqr(old) */
  1441.    return(floatbailout());
  1442. }
  1443.  
  1444. SkinnerTrigSubSqrFractal()
  1445. {
  1446.    /* { z=pixel: z=sin(z)-sqr(z), |z|<BAILOUT }           */
  1447.    LCMPLXtrig0(lold,lnew);    /* lnew = trig(lold)         */
  1448.    LCMPLXsqr_old(ltmp);        /* lold = sqr(lold)          */
  1449.    LCMPLXsub(lnew,ltmp,lnew);  /* lnew = trig(lold)-sqr(lold) */
  1450.    LONGBAILOUT();
  1451.    return(0);
  1452. }
  1453.  
  1454. SkinnerTrigSubSqrfpFractal()
  1455. {
  1456.    /* { z=pixel: z=sin(z)-sqr(z), |z|<BAILOUT } */
  1457.    CMPLXtrig0(old,new);       /* new = trig(old) */
  1458.    CMPLXsqr_old(tmp);           /* old = sqr(old)  */
  1459.    CMPLXsub(new,tmp,new);      /* new = trig(old)-sqr(old) */
  1460.    return(floatbailout());
  1461. }
  1462.  
  1463. TrigZsqrdfpFractal()
  1464. {
  1465.    /* { z=pixel: z=trig(z*z), |z|<TEST } */
  1466.    CMPLXsqr_old(tmp);
  1467.    CMPLXtrig0(tmp,new);
  1468.    return(floatbailout());
  1469. }
  1470.  
  1471. TrigZsqrdFractal() /* this doesn't work very well */
  1472. {
  1473.    /* { z=pixel: z=trig(z*z), |z|<TEST } */
  1474.    LCMPLXsqr_old(ltmp);
  1475.    LCMPLXtrig0(ltmp,lnew);
  1476.    if(overflow)
  1477.       TryFloatFractal(TrigZsqrdfpFractal);
  1478.    LONGBAILOUT();
  1479.    return(0);
  1480. }
  1481.  
  1482. SqrTrigFractal()
  1483. {
  1484.    /* { z=pixel: z=sqr(trig(z)), |z|<TEST} */
  1485.    LCMPLXtrig0(lold,ltmp);
  1486.    LCMPLXsqr(ltmp,lnew);
  1487.    LONGBAILOUT();
  1488.    return(0);
  1489. }
  1490.  
  1491. SqrTrigfpFractal()
  1492. {
  1493.    /* SZSB(XYAXIS) { z=pixel, TEST=(p1+3): z=sin(z)*sin(z), |z|<TEST} */
  1494.    CMPLXtrig0(old,tmp);
  1495.    CMPLXsqr(tmp,new);
  1496.    return(floatbailout());
  1497. }
  1498.  
  1499.  
  1500. Magnet1Fractal()    /*      Z = ((Z**2 + C - 1)/(2Z + C - 2))**2      */
  1501.   {              /*  In "Beauty of Fractals", code by Kev Allen. */
  1502.     CMPLX top, bot, tmp;
  1503.     double div;
  1504.  
  1505.     top.x = tempsqrx - tempsqry + floatparm->x - 1; /* top = Z**2+C-1 */
  1506.     top.y = old.x * old.y;
  1507.     top.y = top.y + top.y + floatparm->y;
  1508.  
  1509.     bot.x = old.x + old.x + floatparm->x - 2;        /* bot = 2*Z+C-2  */
  1510.     bot.y = old.y + old.y + floatparm->y;
  1511.  
  1512.     div = bot.x*bot.x + bot.y*bot.y;            /* tmp = top/bot  */
  1513.     if (div < FLT_MIN) return(1);
  1514.     tmp.x = (top.x*bot.x + top.y*bot.y)/div;
  1515.     tmp.y = (top.y*bot.x - top.x*bot.y)/div;
  1516.  
  1517.     new.x = (tmp.x + tmp.y) * (tmp.x - tmp.y);        /* Z = tmp**2     */
  1518.     new.y = tmp.x * tmp.y;
  1519.     new.y += new.y;
  1520.  
  1521.     return(floatbailout());
  1522.   }
  1523.  
  1524. Magnet2Fractal()  /* Z = ((Z**3 + 3(C-1)Z + (C-1)(C-2)    ) /     */
  1525.             /*         (3Z**2 + 3(C-2)Z + (C-1)(C-2)+1) )**2  */
  1526.   {            /*     In "Beauty of Fractals", code by Kev Allen.  */
  1527.     CMPLX top, bot, tmp;
  1528.     double div;
  1529.  
  1530.     top.x = old.x * (tempsqrx-tempsqry-tempsqry-tempsqry + T_Cm1.x)
  1531.       - old.y * T_Cm1.y + T_Cm1Cm2.x;
  1532.     top.y = old.y * (tempsqrx+tempsqrx+tempsqrx-tempsqry + T_Cm1.x)
  1533.       + old.x * T_Cm1.y + T_Cm1Cm2.y;
  1534.  
  1535.     bot.x = tempsqrx - tempsqry;
  1536.     bot.x = bot.x + bot.x + bot.x
  1537.       + old.x * T_Cm2.x - old.y * T_Cm2.y
  1538.       + T_Cm1Cm2.x + 1.0;
  1539.     bot.y = old.x * old.y;
  1540.     bot.y += bot.y;
  1541.     bot.y = bot.y + bot.y + bot.y
  1542.       + old.x * T_Cm2.y + old.y * T_Cm2.x
  1543.       + T_Cm1Cm2.y;
  1544.  
  1545.     div = bot.x*bot.x + bot.y*bot.y;            /* tmp = top/bot  */
  1546.     if (div < FLT_MIN) return(1);
  1547.     tmp.x = (top.x*bot.x + top.y*bot.y)/div;
  1548.     tmp.y = (top.y*bot.x - top.x*bot.y)/div;
  1549.  
  1550.     new.x = (tmp.x + tmp.y) * (tmp.x - tmp.y);        /* Z = tmp**2     */
  1551.     new.y = tmp.x * tmp.y;
  1552.     new.y += new.y;
  1553.  
  1554.     return(floatbailout());
  1555.   }
  1556.  
  1557. LambdaTrigFractal()
  1558. {
  1559.    LONGXYTRIGBAILOUT();
  1560.    LCMPLXtrig0(lold,ltmp);         /* ltmp = trig(lold)        */
  1561.    LCMPLXmult(*longparm,ltmp,lnew);   /* lnew = longparm*trig(lold)  */
  1562.    lold = lnew;
  1563.    return(0);
  1564. }
  1565.  
  1566. LambdaTrigfpFractal()
  1567. {
  1568.    FLOATXYTRIGBAILOUT();
  1569.    CMPLXtrig0(old,tmp);          /* tmp = trig(old)       */
  1570.    CMPLXmult(*floatparm,tmp,new);   /* new = longparm*trig(old)  */
  1571.    old = new;
  1572.    return(0);
  1573. }
  1574.  
  1575. /* bailouts are different for different trig functions */
  1576. LambdaTrigFractal1()
  1577. {
  1578.    LONGTRIGBAILOUT(); /* sin,cos */
  1579.    LCMPLXtrig0(lold,ltmp);         /* ltmp = trig(lold)        */
  1580.    LCMPLXmult(*longparm,ltmp,lnew);   /* lnew = longparm*trig(lold)  */
  1581.    lold = lnew;
  1582.    return(0);
  1583. }
  1584.  
  1585. LambdaTrigfpFractal1()
  1586. {
  1587.    FLOATTRIGBAILOUT(); /* sin,cos */
  1588.    CMPLXtrig0(old,tmp);          /* tmp = trig(old)       */
  1589.    CMPLXmult(*floatparm,tmp,new);   /* new = longparm*trig(old)  */
  1590.    old = new;
  1591.    return(0);
  1592. }
  1593.  
  1594. LambdaTrigFractal2()
  1595. {
  1596.    LONGHTRIGBAILOUT(); /* sinh,cosh */
  1597.    LCMPLXtrig0(lold,ltmp);         /* ltmp = trig(lold)        */
  1598.    LCMPLXmult(*longparm,ltmp,lnew);   /* lnew = longparm*trig(lold)  */
  1599.    lold = lnew;
  1600.    return(0);
  1601. }
  1602.  
  1603. LambdaTrigfpFractal2()
  1604. {
  1605.    FLOATHTRIGBAILOUT(); /* sinh,cosh */
  1606.    CMPLXtrig0(old,tmp);          /* tmp = trig(old)       */
  1607.    CMPLXmult(*floatparm,tmp,new);   /* new = longparm*trig(old)  */
  1608.    old = new;
  1609.    return(0);
  1610. }
  1611.  
  1612. ManOWarFractal()
  1613. {
  1614.    /* From Art Matrix via Lee Skinner */
  1615.    lnew.x  = ltempsqrx - ltempsqry + ltmp.x + longparm->x;
  1616.    lnew.y = multiply(lold.x, lold.y, bitshiftless1) + ltmp.y + longparm->y;
  1617.    ltmp = lold;
  1618.    LONGBAILOUT();
  1619.    return(0);
  1620. }
  1621.  
  1622. ManOWarfpFractal()
  1623. {
  1624.    /* From Art Matrix via Lee Skinner */
  1625.    new.x = tempsqrx - tempsqry + tmp.x + floatparm->x;
  1626.    new.y = 2.0 * old.x * old.y + tmp.y + floatparm->y;
  1627.    tmp = old;
  1628.    return(floatbailout());
  1629. }
  1630.  
  1631.  
  1632. /* -------------------------------------------------------------------- */
  1633. /*        Initialization (once per pixel) routines                        */
  1634. /* -------------------------------------------------------------------- */
  1635.  
  1636. #if 0
  1637. /* this code translated to asm - lives in newton.asm */
  1638. /* transform points with reciprocal function */
  1639. void invertz1(CMPLX *z)
  1640. {
  1641.    z->x = dx0[col]+dx1[row];
  1642.    z->y = dy0[row]+dy1[col];
  1643.    z->x -= f_xcenter; z->y -= f_ycenter;  /* Normalize values to center of circle */
  1644.  
  1645.    tempsqrx = sqr(z->x) + sqr(z->y);  /* Get old radius */
  1646.    if(fabs(tempsqrx) > FLT_MIN)
  1647.       tempsqrx = f_radius / tempsqrx;
  1648.    else
  1649.       tempsqrx = FLT_MAX;   /* a big number, but not TOO big */
  1650.    z->x *= tempsqrx;      z->y *= tempsqrx;     /* Perform inversion */
  1651.    z->x += f_xcenter; z->y += f_ycenter; /* Renormalize */
  1652. }
  1653. #endif
  1654.  
  1655. int long_julia_per_pixel()
  1656. {
  1657.    /* integer julia types */
  1658.    /* lambda */
  1659.    /* barnsleyj1 */
  1660.    /* barnsleyj2 */
  1661.    /* sierpinski */
  1662.    if(invert)
  1663.    {
  1664.       /* invert */
  1665.       invertz2(&old);
  1666.  
  1667.       /* watch out for overflow */
  1668.       if(sqr(old.x)+sqr(old.y) >= 127)
  1669.       {
  1670.      old.x = 8;  /* value to bail out in one iteration */
  1671.      old.y = 8;
  1672.       }
  1673.  
  1674.       /* convert to fudged longs */
  1675.       lold.x = old.x*fudge;
  1676.       lold.y = old.y*fudge;
  1677.    }
  1678.    else
  1679.    {
  1680.       lold.x = lx0[col]+lx1[row];
  1681.       lold.y = ly0[row]+ly1[col];
  1682.    }
  1683.    return(0);
  1684. }
  1685.  
  1686. int long_mandel_per_pixel()
  1687. {
  1688.    /* integer mandel types */
  1689.    /* barnsleym1 */
  1690.    /* barnsleym2 */
  1691.    linit.x = lx0[col]+lx1[row];
  1692.  
  1693.    if(invert)
  1694.    {
  1695.       /* invert */
  1696.       invertz2(&init);
  1697.  
  1698.       /* watch out for overflow */
  1699.       if(sqr(init.x)+sqr(init.y) >= 127)
  1700.       {
  1701.      init.x = 8;  /* value to bail out in one iteration */
  1702.      init.y = 8;
  1703.       }
  1704.  
  1705.       /* convert to fudged longs */
  1706.       linit.x = init.x*fudge;
  1707.       linit.y = init.y*fudge;
  1708.    }
  1709.  
  1710.    if(useinitorbit == 1)
  1711.       lold = linitorbit;
  1712.    else
  1713.       lold = linit;
  1714.  
  1715.    lold.x += lparm.x;     /* initial pertubation of parameters set */
  1716.    lold.y += lparm.y;
  1717.    return(1); /* 1st iteration has been done */
  1718. }
  1719.  
  1720. int julia_per_pixel()
  1721. {
  1722.    /* julia */
  1723.  
  1724.    if(invert)
  1725.    {
  1726.       /* invert */
  1727.       invertz2(&old);
  1728.  
  1729.       /* watch out for overflow */
  1730.       if(bitshift <= 24)
  1731.      if (sqr(old.x)+sqr(old.y) >= 127)
  1732.      {
  1733.         old.x = 8;    /* value to bail out in one iteration */
  1734.         old.y = 8;
  1735.      }
  1736.       if(bitshift >  24)
  1737.      if (sqr(old.x)+sqr(old.y) >= 4.0)
  1738.      {
  1739.         old.x = 2;    /* value to bail out in one iteration */
  1740.         old.y = 2;
  1741.      }
  1742.  
  1743.       /* convert to fudged longs */
  1744.       lold.x = old.x*fudge;
  1745.       lold.y = old.y*fudge;
  1746.    }
  1747.    else
  1748.    {
  1749.       lold.x = lx0[col]+lx1[row];
  1750.       lold.y = ly0[row]+ly1[col];
  1751.    }
  1752.  
  1753.    ltempsqrx = multiply(lold.x, lold.x, bitshift);
  1754.    ltempsqry = multiply(lold.y, lold.y, bitshift);
  1755.    return(0);
  1756. }
  1757.  
  1758. int mandel_per_pixel()
  1759. {
  1760.    /* mandel */
  1761.  
  1762.    if(invert)
  1763.    {
  1764.       invertz2(&init);
  1765.  
  1766.       /* watch out for overflow */
  1767.       if(bitshift <= 24)
  1768.      if (sqr(init.x)+sqr(init.y) >= 127)
  1769.      {
  1770.         init.x = 8;  /* value to bail out in one iteration */
  1771.         init.y = 8;
  1772.      }
  1773.       if(bitshift >  24)
  1774.      if (sqr(init.x)+sqr(init.y) >= 4)
  1775.      {
  1776.         init.x = 2;  /* value to bail out in one iteration */
  1777.         init.y = 2;
  1778.      }
  1779.  
  1780.       /* convert to fudged longs */
  1781.       linit.x = init.x*fudge;
  1782.       linit.y = init.y*fudge;
  1783.    }
  1784.    else
  1785.       linit.x = lx0[col]+lx1[row];
  1786.    switch (fractype)
  1787.      {
  1788.     case MANDELLAMBDA:        /* Critical Value 0.5 + 0.0i  */
  1789.         lold.x = FgHalf;
  1790.         lold.y = 0;
  1791.         break;
  1792.     default:
  1793.         lold = linit;
  1794.         break;
  1795.       }
  1796.  
  1797.    /* alter init value */
  1798.    if(useinitorbit == 1)
  1799.       lold = linitorbit;
  1800.    else if(useinitorbit == 2)
  1801.       lold = linit;
  1802.  
  1803.    if(inside == -60 || inside == -61)
  1804.    {
  1805.       /* kludge to match "Beauty of Fractals" picture since we start
  1806.      Mandelbrot iteration with init rather than 0 */
  1807.       lold.x = lparm.x; /* initial pertubation of parameters set */
  1808.       lold.y = lparm.y;
  1809.       color = -1;
  1810.    }
  1811.    else
  1812.    {
  1813.       lold.x += lparm.x; /* initial pertubation of parameters set */
  1814.       lold.y += lparm.y;
  1815.    }
  1816.    ltmp = linit; /* for spider */
  1817.    ltempsqrx = multiply(lold.x, lold.x, bitshift);
  1818.    ltempsqry = multiply(lold.y, lold.y, bitshift);
  1819.    return(1); /* 1st iteration has been done */
  1820. }
  1821.  
  1822.  
  1823. int marksmandel_per_pixel()
  1824. {
  1825.    /* marksmandel */
  1826.  
  1827.    if(invert)
  1828.    {
  1829.       invertz2(&init);
  1830.  
  1831.       /* watch out for overflow */
  1832.       if(sqr(init.x)+sqr(init.y) >= 127)
  1833.       {
  1834.      init.x = 8;  /* value to bail out in one iteration */
  1835.      init.y = 8;
  1836.       }
  1837.  
  1838.       /* convert to fudged longs */
  1839.       linit.x = init.x*fudge;
  1840.       linit.y = init.y*fudge;
  1841.    }
  1842.    else
  1843.       linit.x = lx0[col]+lx1[row];
  1844.  
  1845.    if(useinitorbit == 1)
  1846.       lold = linitorbit;
  1847.    else
  1848.       lold = linit;
  1849.  
  1850.    lold.x += lparm.x;     /* initial pertubation of parameters set */
  1851.    lold.y += lparm.y;
  1852.  
  1853.    if(c_exp > 3)
  1854.       lcpower(&lold,c_exp-1,&lcoefficient,bitshift);
  1855.    else if(c_exp == 3) {
  1856.       lcoefficient.x = multiply(lold.x, lold.x, bitshift)
  1857.      - multiply(lold.y, lold.y, bitshift);
  1858.       lcoefficient.y = multiply(lold.x, lold.y, bitshiftless1);
  1859.    }
  1860.    else if(c_exp == 2)
  1861.       lcoefficient = lold;
  1862.    else if(c_exp < 2) {
  1863.       lcoefficient.x = 1L << bitshift;
  1864.       lcoefficient.y = 0L;
  1865.    }
  1866.  
  1867.    ltempsqrx = multiply(lold.x, lold.x, bitshift);
  1868.    ltempsqry = multiply(lold.y, lold.y, bitshift);
  1869.    return(1); /* 1st iteration has been done */
  1870. }
  1871.  
  1872. int mandelfp_per_pixel()
  1873. {
  1874.    /* floating point mandelbrot */
  1875.    /* mandelfp */
  1876.  
  1877.    if(invert)
  1878.       invertz2(&init);
  1879.    else
  1880.       init.x = dx0[col]+dx1[row];
  1881.     switch (fractype)
  1882.       {
  1883.     case MAGNET2M:
  1884.         FloatPreCalcMagnet2();
  1885.     case MAGNET1M:         /* Crit Val Zero both, but neither   */
  1886.         old.x = old.y = 0.0; /* is of the form f(Z,C) = Z*g(Z)+C  */
  1887.         break;
  1888.     case MANDELLAMBDAFP:        /* Critical Value 0.5 + 0.0i  */
  1889.         old.x = 0.5;
  1890.         old.y = 0.0;
  1891.         break;
  1892.     default:
  1893.         old = init;
  1894.         break;
  1895.       }
  1896.  
  1897.    /* alter init value */
  1898.    if(useinitorbit == 1)
  1899.       old = initorbit;
  1900.    else if(useinitorbit == 2)
  1901.       old = init;
  1902.  
  1903.    if(inside == -60 || inside == -61)
  1904.    {
  1905.       /* kludge to match "Beauty of Fractals" picture since we start
  1906.      Mandelbrot iteration with init rather than 0 */
  1907.       old.x = parm.x; /* initial pertubation of parameters set */
  1908.       old.y = parm.y;
  1909.       color = -1;
  1910.    }
  1911.    else
  1912.    {
  1913.      old.x += parm.x;
  1914.      old.y += parm.y;
  1915.    }
  1916.    tmp = init; /* for spider */
  1917.    tempsqrx = sqr(old.x);  /* precalculated value for regular Mandelbrot */
  1918.    tempsqry = sqr(old.y);
  1919.    return(1); /* 1st iteration has been done */
  1920. }
  1921.  
  1922. int juliafp_per_pixel()
  1923. {
  1924.    /* floating point julia */
  1925.    /* juliafp */
  1926.    if(invert)
  1927.       invertz2(&old);
  1928.    else
  1929.    {
  1930.      old.x = dx0[col]+dx1[row];
  1931.      old.y = dy0[row]+dy1[col];
  1932.    }
  1933.    tempsqrx = sqr(old.x);  /* precalculated value for regular Julia */
  1934.    tempsqry = sqr(old.y);
  1935.    return(0);
  1936. }
  1937.  
  1938. int MPCjulia_per_pixel()
  1939. {
  1940.    /* floating point julia */
  1941.    /* juliafp */
  1942.    if(invert)
  1943.       invertz2(&old);
  1944.    else
  1945.    {
  1946.      old.x = dx0[col]+dx1[row];
  1947.      old.y = dy0[row]+dy1[col];
  1948.    }
  1949.    mpcold.x = pd2MP(old.x);
  1950.    mpcold.y = pd2MP(old.y);
  1951.    return(0);
  1952. }
  1953.  
  1954. int othermandelfp_per_pixel()
  1955. {
  1956.    if(invert)
  1957.       invertz2(&init);
  1958.    else
  1959.       init.x = dx0[col]+dx1[row];
  1960.  
  1961.    if(useinitorbit == 1)
  1962.       old = initorbit;
  1963.    else
  1964.       old = init;
  1965.  
  1966.    old.x += parm.x;     /* initial pertubation of parameters set */
  1967.    old.y += parm.y;
  1968.  
  1969.    return(1); /* 1st iteration has been done */
  1970. }
  1971.  
  1972. int otherjuliafp_per_pixel()
  1973. {
  1974.    if(invert)
  1975.       invertz2(&old);
  1976.    else
  1977.    {
  1978.       old.x = dx0[col]+dx1[row];
  1979.       old.y = dy0[row]+dy1[col];
  1980.    }
  1981.    return(0);
  1982. }
  1983.  
  1984. int trigmandelfp_per_pixel()
  1985. {
  1986.    if(invert)
  1987.       invertz2(&init);
  1988.    else
  1989.       init.x = dx0[col]+dx1[row];
  1990.  
  1991.    if(useinitorbit == 1)
  1992.       old = initorbit;
  1993.    else
  1994.       old = init;
  1995.  
  1996.    old.x += parm.x;     /* initial pertubation of parameters set */
  1997.    old.y += parm.y;
  1998.    CMPLXtrig0(old,old);
  1999.    return(1); /* 1st iteration has been done */
  2000. }
  2001.  
  2002. int trigjuliafp_per_pixel()
  2003. {
  2004.    /* for tetrated types */
  2005.    if(invert)
  2006.       invertz2(&old);
  2007.    else
  2008.    {
  2009.       old.x = dx0[col]+dx1[row];
  2010.       old.y = dy0[row]+dy1[col];
  2011.    }
  2012.    CMPLXtrig0(old,old);
  2013.    return(0);
  2014. }
  2015.  
  2016. int trigXtrigmandelfp_per_pixel()
  2017. {
  2018.    if(invert)
  2019.       invertz2(&init);
  2020.    else
  2021.       init.x = dx0[col]+dx1[row];
  2022.  
  2023.    if(useinitorbit == 1)
  2024.       old = initorbit;
  2025.    else
  2026.       old = init;
  2027.  
  2028.    old.x += parm.x;     /* initial pertubation of parameters set */
  2029.    old.y += parm.y;
  2030.    CMPLXtrig0(old,tmp);
  2031.    CMPLXtrig1(old,tmp2);
  2032.    CMPLXmult(tmp,tmp2,old);
  2033.    return(1); /* 1st iteration has been done */
  2034. }
  2035.  
  2036. int trigXtrigjuliafp_per_pixel()
  2037. {
  2038.    if(invert)
  2039.       invertz2(&old);
  2040.    else
  2041.    {
  2042.       old.x = dx0[col]+dx1[row];
  2043.       old.y = dy0[row]+dy1[col];
  2044.    }
  2045.    CMPLXtrig0(old,tmp);
  2046.    CMPLXtrig1(old,tmp2);
  2047.    CMPLXmult(tmp,tmp2,old);
  2048.    return(0);
  2049. }
  2050.  
  2051. int MarksCplxMandperp(void)
  2052. {
  2053.    if(invert)
  2054.       invertz2(&init);
  2055.    else
  2056.       init.x = dx0[col]+dx1[row];
  2057.    old.x = init.x + parm.x; /* initial pertubation of parameters set */
  2058.    old.y = init.y + parm.y;
  2059.    tempsqrx = sqr(old.x);  /* precalculated value */
  2060.    tempsqry = sqr(old.y);
  2061.    Coefficient = ComplexPower(init, pwr);
  2062.    return(1);
  2063. }
  2064.  
  2065. /* -------------------------------------------------------------------- */
  2066. /*        Setup (once per fractal image) routines         */
  2067. /* -------------------------------------------------------------------- */
  2068.  
  2069. MandelSetup()        /* Mandelbrot Routine */
  2070. {
  2071.    if (debugflag != 90 && ! invert && decomp[0] == 0 && rqlim <= 4.0
  2072.        && bitshift == 29 && potflag == 0
  2073.        && biomorph == -1 && inside != -60
  2074.        && inside != -61 && outside == -1 && useinitorbit != 1)
  2075.       calctype = calcmand; /* the normal case - use CALCMAND */
  2076.    else
  2077.    {
  2078.       /* special case: use the main processing loop */
  2079.       calctype = StandardFractal;
  2080.       longparm = &linit;
  2081.    }
  2082.    return(1);
  2083. }
  2084.  
  2085. JuliaSetup()        /* Julia Routine */
  2086. {
  2087.    if (debugflag != 90 && ! invert && decomp[0] == 0 && rqlim <= 4.0
  2088.        && bitshift == 29 && potflag == 0
  2089.        && biomorph == -1 && inside != -60
  2090.        && inside != -61 && outside == -1 && !finattract)
  2091.       calctype = calcmand; /* the normal case - use CALCMAND */
  2092.    else
  2093.    {
  2094.       /* special case: use the main processing loop */
  2095.       calctype = StandardFractal;
  2096.       longparm = &lparm;
  2097.       get_julia_attractor (0.0, 0.0);    /* another attractor? */
  2098.    }
  2099.    return(1);
  2100. }
  2101.  
  2102. NewtonSetup()        /* Newton/NewtBasin Routines */
  2103. {
  2104.    int i;
  2105.    extern int basin;
  2106.    extern int fpu;
  2107.    if(fpu != 0 && debugflag != 1010)
  2108.    {
  2109.       if(fractype == MPNEWTON)
  2110.      fractype = NEWTON;
  2111.       else if(fractype == MPNEWTBASIN)
  2112.      fractype = NEWTBASIN;
  2113.    }
  2114.  
  2115.    if(fpu == 0 && debugflag != 1010)
  2116.    {
  2117.       if(fractype == NEWTON)
  2118.         fractype = MPNEWTON;
  2119.       else if(fractype == NEWTBASIN)
  2120.         fractype = MPNEWTBASIN;
  2121.    }
  2122.  
  2123.    /* set up table of roots of 1 along unit circle */
  2124.    degree = (int)parm.x;
  2125.    if(degree < 2)
  2126.       degree = 3;   /* defaults to 3, but 2 is possible */
  2127.    root = 1;
  2128.  
  2129.    /* precalculated values */
  2130.    roverd    = (double)root / (double)degree;
  2131.    d1overd    = (double)(degree - 1) / (double)degree;
  2132.    maxcolor    = 0;
  2133.    threshold    = .3*PI/degree; /* less than half distance between roots */
  2134.    if (fractype == MPNEWTON || fractype == MPNEWTBASIN) {
  2135.       mproverd       = pd2MP(roverd);
  2136.       mpd1overd    = pd2MP(d1overd);
  2137.       mpthreshold  = pd2MP(threshold);
  2138.       mpone       = pd2MP(1.0);
  2139.    }
  2140.  
  2141.    floatmin = FLT_MIN;
  2142.    floatmax = FLT_MAX;
  2143.  
  2144.    basin = 0;
  2145.    if(roots != staticroots) {
  2146.       free(roots);
  2147.       roots = staticroots;
  2148.    }
  2149.  
  2150.    if (fractype==NEWTBASIN)
  2151.    {
  2152.       if(parm.y)
  2153.      basin = 2; /*stripes */
  2154.       else
  2155.      basin = 1;
  2156.       if(degree > 16)
  2157.       {
  2158.      if((roots=(CMPLX *)malloc(degree*sizeof(CMPLX)))==NULL)
  2159.      {
  2160.         roots = staticroots;
  2161.         degree = 16;
  2162.      }
  2163.       }
  2164.       else
  2165.      roots = staticroots;
  2166.  
  2167.       /* list of roots to discover where we converged for newtbasin */
  2168.       for(i=0;i<degree;i++)
  2169.       {
  2170.      roots[i].x = cos(i*PI*2.0/(double)degree);
  2171.      roots[i].y = sin(i*PI*2.0/(double)degree);
  2172.       }
  2173.    }
  2174.    else if (fractype==MPNEWTBASIN)
  2175.    {
  2176.      if(parm.y)
  2177.      basin = 2; /*stripes */
  2178.       else
  2179.      basin = 1;
  2180.  
  2181.       if(degree > 16)
  2182.       {
  2183.      if((MPCroots=(struct MPC *)malloc(degree*sizeof(struct MPC)))==NULL)
  2184.      {
  2185.         MPCroots = (struct MPC *)staticroots;
  2186.         degree = 16;
  2187.      }
  2188.       }
  2189.       else
  2190.      MPCroots = (struct MPC *)staticroots;
  2191.  
  2192.       /* list of roots to discover where we converged for newtbasin */
  2193.       for(i=0;i<degree;i++)
  2194.       {
  2195.      MPCroots[i].x = pd2MP(cos(i*PI*2.0/(double)degree));
  2196.      MPCroots[i].y = pd2MP(sin(i*PI*2.0/(double)degree));
  2197.       }
  2198.    }
  2199.  
  2200.    if (degree%4 == 0)
  2201.       symmetry = XYAXIS;
  2202.    else
  2203.       symmetry = XAXIS;
  2204.  
  2205.    calctype=StandardFractal;
  2206.    if (fractype == MPNEWTON || fractype == MPNEWTBASIN)
  2207.       setMPfunctions();
  2208.    return(1);
  2209. }
  2210.  
  2211.  
  2212. StandaloneSetup()
  2213. {
  2214.    timer(0,fractalspecific[fractype].calctype);
  2215.    return(0);        /* effectively disable solid-guessing */
  2216. }
  2217.  
  2218. UnitySetup()
  2219. {
  2220.    periodicitycheck = 0;
  2221.    FgOne = (1L << bitshift);
  2222.    FgTwo = FgOne + FgOne;
  2223.    return(1);
  2224. }
  2225.  
  2226. MandelfpSetup()
  2227. {
  2228.    c_exp = param[2];
  2229.    if(fractype==FPMANDELZPOWER && c_exp < 1)
  2230.       c_exp = 1;
  2231.    if(fractype==FPMANDELZPOWER && c_exp & 1) /* odd exponents */
  2232.       symmetry = XYAXIS_NOPARM;
  2233.  
  2234.    pwr.x = param[2] - 1.0;
  2235.    pwr.y = param[3];
  2236.  
  2237.    floatparm = &init;
  2238.    switch (fractype)
  2239.    {
  2240.    case MAGNET1M:
  2241.    case MAGNET2M:
  2242.       attr[0].x = 1.0;        /* 1.0 + 0.0i always attracts */
  2243.       attr[0].y = 0.0;        /* - both MAGNET1 and MAGNET2 */
  2244.       attractors = 1;
  2245.       break;
  2246.    case SPIDERFP:
  2247.       if(periodicitycheck==1) /* if not user set */
  2248.      periodicitycheck=4;
  2249.       break;
  2250.    case MANDELEXP:
  2251.       symmetry = XAXIS_NOPARM;
  2252.       break;
  2253.    default:
  2254.       break;
  2255.    }
  2256.    return(1);
  2257. }
  2258.  
  2259. JuliafpSetup()
  2260. {
  2261.    c_exp = param[2];
  2262.    if(fractype==FPJULIAZPOWER && c_exp < 1)
  2263.       c_exp = 1;
  2264.    if(fractype==FPJULIAZPOWER && c_exp & 1) /* odd exponents */
  2265.       symmetry = NOSYM;
  2266.    floatparm = &parm;
  2267.    if(fractype==COMPLEXMARKSJUL)
  2268.    {
  2269.       pwr.x = param[2] - 1.0;
  2270.       pwr.y = param[3];
  2271.       Coefficient = ComplexPower(*floatparm, pwr);
  2272.    }
  2273.    switch (fractype)
  2274.    {
  2275.    case MAGNET2J:
  2276.       FloatPreCalcMagnet2();
  2277.    case MAGNET1J:
  2278.       attr[0].x = 1.0;        /* 1.0 + 0.0i always attracts */
  2279.       attr[0].y = 0.0;        /* - both MAGNET1 and MAGNET2 */
  2280.       attractors = 1;
  2281.       get_julia_attractor (0.0, 0.0);    /* another attractor? */
  2282.       break;
  2283.    case LAMBDAFP:
  2284.       get_julia_attractor (0.0, 0.0);    /* another attractor? */
  2285.       get_julia_attractor (0.5, 0.0);    /* another attractor? */
  2286.       break;
  2287.    case LAMBDAEXP:
  2288.       if(parm.y == 0.0)
  2289.      symmetry=XAXIS;
  2290.       get_julia_attractor (0.0, 0.0);    /* another attractor? */
  2291.       break;
  2292.    default:
  2293.       get_julia_attractor (0.0, 0.0);    /* another attractor? */
  2294.       break;
  2295.    }
  2296.    return(1);
  2297. }
  2298.  
  2299. MandellongSetup()
  2300. {
  2301.    FgHalf = fudge >> 1;
  2302.    c_exp = param[2];
  2303.    if(fractype==MARKSMANDEL && c_exp < 1)
  2304.       c_exp = 1;
  2305.    if(fractype==LMANDELZPOWER && c_exp < 1)
  2306.       c_exp = 1;
  2307.    if((fractype==MARKSMANDEL   && !(c_exp & 1)) ||
  2308.        (fractype==LMANDELZPOWER && c_exp & 1))
  2309.       symmetry = XYAXIS_NOPARM;    /* odd exponents */
  2310.    if((fractype==MARKSMANDEL && (c_exp & 1)) || fractype==LMANDELEXP)
  2311.       symmetry = XAXIS_NOPARM;
  2312.    if(fractype==SPIDER && periodicitycheck==1)
  2313.       periodicitycheck=4;
  2314.    longparm = &linit;
  2315.    return(1);
  2316. }
  2317.  
  2318. JulialongSetup()
  2319. {
  2320.    c_exp = param[2];
  2321.    if(fractype==LJULIAZPOWER && c_exp < 1)
  2322.       c_exp = 1;
  2323.    if(fractype==LJULIAZPOWER && c_exp & 1) /* odd exponents */
  2324.       symmetry = NOSYM;
  2325.    longparm = &lparm;
  2326.    switch (fractype)
  2327.    {
  2328.    case LAMBDA:
  2329.       get_julia_attractor (0.0, 0.0);    /* another attractor? */
  2330.       get_julia_attractor (0.5, 0.0);    /* another attractor? */
  2331.       break;
  2332.    case LLAMBDAEXP:
  2333.       if(lparm.y == 0)
  2334.      symmetry = XAXIS;
  2335.       break;
  2336.    default:
  2337.       get_julia_attractor (0.0, 0.0);    /* another attractor? */
  2338.       break;
  2339.    }
  2340.    return(1);
  2341. }
  2342.  
  2343. TrigPlusSqrlongSetup()
  2344. {
  2345.    fractalspecific[fractype].per_pixel =  julia_per_pixel;
  2346.    fractalspecific[fractype].orbitcalc =  TrigPlusSqrFractal;
  2347.    if(lparm.x == fudge && lparm.y == 0L && lparm2.y == 0L && debugflag != 90)
  2348.    {
  2349.       if(lparm2.x == fudge)       /* Scott variant */
  2350.      fractalspecific[fractype].orbitcalc =    ScottTrigPlusSqrFractal;
  2351.       else if(lparm2.x == -fudge)  /* Skinner variant */
  2352.      fractalspecific[fractype].orbitcalc =    SkinnerTrigSubSqrFractal;
  2353.    }
  2354.    return(JulialongSetup());
  2355. }
  2356.  
  2357. TrigPlusSqrfpSetup()
  2358. {
  2359.    fractalspecific[fractype].per_pixel =  juliafp_per_pixel;
  2360.    fractalspecific[fractype].orbitcalc =  TrigPlusSqrfpFractal;
  2361.    if(parm.x == 1.0 && parm.y == 0.0 && parm2.y == 0.0 && debugflag != 90)
  2362.    {
  2363.       if(parm2.x == 1.0)    /* Scott variant */
  2364.      fractalspecific[fractype].orbitcalc =    ScottTrigPlusSqrfpFractal;
  2365.       else if(parm2.x == -1.0)    /* Skinner variant */
  2366.      fractalspecific[fractype].orbitcalc =    SkinnerTrigSubSqrfpFractal;
  2367.    }
  2368.    return(JuliafpSetup());
  2369. }
  2370.  
  2371. TrigPlusTriglongSetup()
  2372. {
  2373.    FnPlusFnSym();
  2374.    if(trigndx[1] == SQR)
  2375.       return(TrigPlusSqrlongSetup());
  2376.    fractalspecific[fractype].per_pixel =  long_julia_per_pixel;
  2377.    fractalspecific[fractype].orbitcalc =  TrigPlusTrigFractal;
  2378.    if(lparm.x == fudge && lparm.y == 0L && lparm2.y == 0L && debugflag != 90)
  2379.    {
  2380.       if(lparm2.x == fudge)       /* Scott variant */
  2381.      fractalspecific[fractype].orbitcalc =    ScottTrigPlusTrigFractal;
  2382.       else if(lparm2.x == -fudge)  /* Skinner variant */
  2383.      fractalspecific[fractype].orbitcalc =    SkinnerTrigSubTrigFractal;
  2384.    }
  2385.    return(JulialongSetup());
  2386. }
  2387.  
  2388. TrigPlusTrigfpSetup()
  2389. {
  2390.    FnPlusFnSym();
  2391.    if(trigndx[1] == SQR)
  2392.       return(TrigPlusSqrfpSetup());
  2393.    fractalspecific[fractype].per_pixel =  otherjuliafp_per_pixel;
  2394.    fractalspecific[fractype].orbitcalc =  TrigPlusTrigfpFractal;
  2395.    if(parm.x == 1.0 && parm.y == 0.0 && parm2.y == 0.0 && debugflag != 90)
  2396.    {
  2397.       if(parm2.x == 1.0)    /* Scott variant */
  2398.      fractalspecific[fractype].orbitcalc =    ScottTrigPlusTrigfpFractal;
  2399.       else if(parm2.x == -1.0)    /* Skinner variant */
  2400.      fractalspecific[fractype].orbitcalc =    SkinnerTrigSubTrigfpFractal;
  2401.    }
  2402.    return(JuliafpSetup());
  2403. }
  2404.  
  2405. FnPlusFnSym() /* set symmetry matrix for fn+fn type */
  2406. {
  2407.    static char far fnplusfn[7][7] =
  2408.    {/* fn2 ->sin     cos    sinh    cosh   sqr      exp     log  */
  2409.    /* fn1 */
  2410.    /* sin */ {PI_SYM,XAXIS, XYAXIS, XAXIS, XAXIS, XAXIS, XAXIS},
  2411.    /* cos */ {XAXIS, PI_SYM,XAXIS,  XYAXIS,XAXIS, XAXIS, XAXIS},
  2412.    /* sinh*/ {XYAXIS,XAXIS, XYAXIS, XAXIS, XAXIS, XAXIS, XAXIS},
  2413.    /* cosh*/ {XAXIS, XYAXIS,XAXIS,  XYAXIS,XAXIS, XAXIS, XAXIS},
  2414.    /* sqr */ {XAXIS, XYAXIS,XAXIS,  XAXIS, XYAXIS,XAXIS, XAXIS},
  2415.    /* exp */ {XAXIS, XAXIS, XAXIS,  XAXIS, XAXIS, XAXIS, XAXIS},
  2416.    /* log */ {XAXIS, XAXIS, XAXIS,  XAXIS, XAXIS, XAXIS, XYAXIS}
  2417.    };
  2418.    if(parm.y == 0.0 && parm2.y == 0.0)
  2419.       symmetry = fnplusfn[trigndx[0]][trigndx[1]];
  2420.    else
  2421.       symmetry = NOSYM;
  2422.    return(0);
  2423. }
  2424.  
  2425. ZXTrigPlusZSetup()
  2426. {
  2427.    static char far ZXTrigPlusZSym1[] =
  2428.    /* fn1 ->  sin   cos    sinh  cosh    sqr    exp   log  */
  2429.          {XAXIS,XYAXIS,XAXIS,XYAXIS,XYAXIS,XAXIS,XAXIS};
  2430.    static char far ZXTrigPlusZSym2[] =
  2431.    /* fn1 ->  sin   cos    sinh  cosh    sqr    exp   log  */
  2432.          {NOSYM,ORIGIN,NOSYM,ORIGIN,XYAXIS,NOSYM,NOSYM};
  2433.    if(param[1] == 0.0 && param[3] == 0.0)
  2434.       symmetry = ZXTrigPlusZSym1[trigndx[0]];
  2435.    else
  2436.       symmetry = ZXTrigPlusZSym2[trigndx[0]];
  2437.  
  2438.    if(fractalspecific[fractype].isinteger)
  2439.    {
  2440.       fractalspecific[fractype].orbitcalc =  ZXTrigPlusZFractal;
  2441.       if(lparm.x == fudge && lparm.y == 0L && lparm2.y == 0L && debugflag != 90)
  2442.       {
  2443.      if(lparm2.x == fudge)       /* Scott variant */
  2444.          fractalspecific[fractype].orbitcalc =    ScottZXTrigPlusZFractal;
  2445.      else if(lparm2.x == -fudge)  /* Skinner variant */
  2446.          fractalspecific[fractype].orbitcalc =    SkinnerZXTrigSubZFractal;
  2447.       }
  2448.       return(JulialongSetup());
  2449.    }
  2450.    else
  2451.    {
  2452.       fractalspecific[fractype].orbitcalc =  ZXTrigPlusZfpFractal;
  2453.       if(parm.x == 1.0 && parm.y == 0.0 && parm2.y == 0.0 && debugflag != 90)
  2454.       {
  2455.      if(parm2.x == 1.0)    /* Scott variant */
  2456.          fractalspecific[fractype].orbitcalc =    ScottZXTrigPlusZfpFractal;
  2457.      else if(parm2.x == -1.0)    /* Skinner variant */
  2458.          fractalspecific[fractype].orbitcalc =    SkinnerZXTrigSubZfpFractal;
  2459.       }
  2460.    }
  2461.    return(JuliafpSetup());
  2462. }
  2463.  
  2464. LambdaTrigSetup()
  2465. {
  2466.    int isinteger;
  2467.    if(isinteger = fractalspecific[fractype].isinteger)
  2468.       fractalspecific[fractype].orbitcalc =  LambdaTrigFractal;
  2469.    else
  2470.       fractalspecific[fractype].orbitcalc =  LambdaTrigfpFractal;
  2471.    switch(trigndx[0])
  2472.    {
  2473.    case SIN:
  2474.    case COS:
  2475.       symmetry = PI_SYM;
  2476.       if(isinteger)
  2477.      fractalspecific[fractype].orbitcalc =    LambdaTrigFractal1;
  2478.       else
  2479.      fractalspecific[fractype].orbitcalc =    LambdaTrigfpFractal1;
  2480.       break;
  2481.    case SINH:
  2482.    case COSH:
  2483.       symmetry = ORIGIN;
  2484.       if(isinteger)
  2485.      fractalspecific[fractype].orbitcalc =    LambdaTrigFractal2;
  2486.       else
  2487.      fractalspecific[fractype].orbitcalc =    LambdaTrigfpFractal2;
  2488.       break;
  2489.    case SQR:
  2490.       symmetry = ORIGIN;
  2491.       break;
  2492.    case EXP:
  2493.       if(isinteger)
  2494.      fractalspecific[fractype].orbitcalc =    LongLambdaexponentFractal;
  2495.       else
  2496.      fractalspecific[fractype].orbitcalc =    LambdaexponentFractal;
  2497.       symmetry = XAXIS;
  2498.       break;
  2499.    case LOG:
  2500.       symmetry = NOSYM;
  2501.       break;
  2502.    }
  2503.    if(isinteger)
  2504.       return(JulialongSetup());
  2505.    else
  2506.       return(JuliafpSetup());
  2507. }
  2508.  
  2509. JuliafnPlusZsqrdSetup()
  2510. {
  2511.    static char far fnpluszsqrd[] =
  2512.    /* fn1 ->  sin   cos    sinh  cosh    sqr    exp   log  */
  2513.    /* sin */ {NOSYM,ORIGIN,NOSYM,ORIGIN,ORIGIN,NOSYM,NOSYM};
  2514.  
  2515.    symmetry = fnpluszsqrd[trigndx[0]];
  2516.    if(fractalspecific[fractype].isinteger)
  2517.       return(JulialongSetup());
  2518.    else
  2519.       return(JuliafpSetup());
  2520. }
  2521.  
  2522. SqrTrigSetup()
  2523. {
  2524.    static char far SqrTrigSym[] =
  2525.    /* fn1 ->  sin    cos    sinh   cosh   sqr     exp   log  */
  2526.          {PI_SYM,PI_SYM,XYAXIS,XYAXIS,XYAXIS,XAXIS,XAXIS};
  2527.    symmetry = SqrTrigSym[trigndx[0]];
  2528.    if(fractalspecific[fractype].isinteger)
  2529.       return(JulialongSetup());
  2530.    else
  2531.       return(JuliafpSetup());
  2532. }
  2533.  
  2534. FnXFnSetup()
  2535. {
  2536.    static char far fnxfn[7][7] =
  2537.    {/* fn2 ->sin     cos    sinh    cosh   sqr      exp     log  */
  2538.    /* fn1 */
  2539.    /* sin */ {PI_SYM,YAXIS, XYAXIS,XYAXIS,XYAXIS,XAXIS, XAXIS},
  2540.    /* cos */ {YAXIS, PI_SYM,XYAXIS,XYAXIS,XYAXIS,XAXIS, XAXIS},
  2541.    /* sinh*/ {XYAXIS,XYAXIS,XYAXIS,XYAXIS,XYAXIS,XAXIS, XAXIS},
  2542.    /* cosh*/ {XYAXIS,XYAXIS,XYAXIS,XYAXIS,XYAXIS,XAXIS, XAXIS},
  2543.    /* sqr */ {XYAXIS,XYAXIS,XYAXIS,XYAXIS,XYAXIS,XAXIS, XAXIS},
  2544.    /* exp */ {XAXIS, XAXIS, XAXIS, XAXIS, XAXIS, XAXIS, XAXIS},
  2545.    /* log */ {XAXIS, XAXIS, XAXIS, XAXIS, XAXIS, XAXIS, XAXIS},
  2546.    };
  2547.    /*
  2548.    if(trigndx[0]==EXP || trigndx[0]==LOG || trigndx[1]==EXP || trigndx[1]==LOG)
  2549.       symmetry = XAXIS;
  2550.    else if((trigndx[0]==SIN && trigndx[1]==SIN)||(trigndx[0]==COS && trigndx[1]==COS))
  2551.       symmetry = PI_SYM;
  2552.    else if((trigndx[0]==SIN && trigndx[1]==COS)||(trigndx[0]==COS && trigndx[1]==SIN))
  2553.       symmetry = YAXIS;
  2554.    else
  2555.       symmetry = XYAXIS;
  2556.    */
  2557.    symmetry = fnxfn[trigndx[0]][trigndx[1]];
  2558.    if(fractalspecific[fractype].isinteger)
  2559.       return(JulialongSetup());
  2560.    else
  2561.       return(JuliafpSetup());
  2562. }
  2563.  
  2564. MandelTrigSetup()
  2565. {
  2566.    int isinteger;
  2567.    if(isinteger = fractalspecific[fractype].isinteger)
  2568.       fractalspecific[fractype].orbitcalc =  LambdaTrigFractal;
  2569.    else
  2570.       fractalspecific[fractype].orbitcalc =  LambdaTrigfpFractal;
  2571.    symmetry = XYAXIS_NOPARM;
  2572.    switch(trigndx[0])
  2573.    {
  2574.    case SIN:
  2575.    case COS:
  2576.       if(isinteger)
  2577.      fractalspecific[fractype].orbitcalc =    LambdaTrigFractal1;
  2578.       else
  2579.      fractalspecific[fractype].orbitcalc =    LambdaTrigfpFractal1;
  2580.       break;
  2581.    case SINH:
  2582.    case COSH:
  2583.       if(isinteger)
  2584.      fractalspecific[fractype].orbitcalc =    LambdaTrigFractal2;
  2585.       else
  2586.      fractalspecific[fractype].orbitcalc =    LambdaTrigfpFractal2;
  2587.       break;
  2588.    case EXP:
  2589.       symmetry = XAXIS_NOPARM;
  2590.       if(isinteger)
  2591.      fractalspecific[fractype].orbitcalc =    LongLambdaexponentFractal;
  2592.       else
  2593.      fractalspecific[fractype].orbitcalc =    LambdaexponentFractal;
  2594.       break;
  2595.    case LOG:
  2596.       symmetry = XAXIS_NOPARM;
  2597.       break;
  2598.    }
  2599.    if(isinteger)
  2600.       return(MandellongSetup());
  2601.    else
  2602.       return(MandelfpSetup());
  2603. }
  2604.  
  2605. MarksJuliaSetup()
  2606. {
  2607.    c_exp = param[2];
  2608.    longparm = &lparm;
  2609.    lold = *longparm;
  2610.    if(c_exp > 2)
  2611.       lcpower(&lold,c_exp,&lcoefficient,bitshift);
  2612.    else if(c_exp == 2)
  2613.    {
  2614.       lcoefficient.x = multiply(lold.x,lold.x,bitshift) - multiply(lold.y,lold.y,bitshift);
  2615.       lcoefficient.y = multiply(lold.x,lold.y,bitshiftless1);
  2616.    }
  2617.    else if(c_exp < 2)
  2618.       lcoefficient = lold;
  2619.    return(1);
  2620. }
  2621.  
  2622. SierpinskiSetup()
  2623. {
  2624.    /* sierpinski */
  2625.    periodicitycheck = 0;        /* disable periodicity checks */
  2626.    ltmp.x = 1;
  2627.    ltmp.x = ltmp.x << bitshift; /* ltmp.x = 1 */
  2628.    ltmp.y = ltmp.x >> 1;            /* ltmp.y = .5 */
  2629.    return(1);
  2630. }
  2631.  
  2632. SierpinskiFPSetup()
  2633. {
  2634.    /* sierpinski */
  2635.    periodicitycheck = 0;        /* disable periodicity checks */
  2636.    tmp.x = 1;
  2637.    tmp.y = 0.5;
  2638.    return(1);
  2639. }
  2640.  
  2641.  
  2642. StandardSetup()
  2643. {
  2644.    if(fractype==UNITYFP)
  2645.       periodicitycheck=0;
  2646.    return(1);
  2647. }
  2648.  
  2649.  
  2650.  
  2651. /* parameter descriptions */
  2652. /* for Mandelbrots */
  2653. static char realz0[] = "Real Perturbation of Z(0)";
  2654. static char imagz0[] = "Imaginary Perturbation of Z(0)";
  2655.  
  2656. /* for Julias */
  2657. static char realparm[] = "Real Part of Parameter";
  2658. static char imagparm[] = "Imaginary Part of Parameter";
  2659.  
  2660. /* for Newtons */
  2661. static char newtdegree[] = "Polynomial Degree (> 2)";
  2662.  
  2663. /* for MarksMandel/Julia */
  2664. static char exponent[] = "Parameter Exponent ( > 0)";
  2665.  
  2666. /* for Complex Newton */
  2667. static char realroot[]     = "Real part of Root";
  2668. static char imagroot[]     = "Imag part of Root";
  2669. static char realdegree[] = "Real part of Degree";
  2670. static char imagdegree[] = "Imag part of Degree";
  2671.  
  2672. /* for Lorenz */
  2673. static char timestep[]       = "Time Step";
  2674.  
  2675. /* for formula */
  2676. static char p1real[] = "Real portion of p1";
  2677. static char p2real[] = "Real portion of p2";
  2678. static char p1imag[] = "Imaginary portion of p1";
  2679. static char p2imag[] = "Imaginary portion of p2";
  2680.  
  2681. /* trig functions */
  2682. static char recoeftrg1[] = "Real Coefficient First Function";
  2683. static char imcoeftrg1[] = "Imag Coefficient First Function";
  2684. static char recoeftrg2[] = "Real Coefficient Second Function";
  2685. static char imcoeftrg2[] = "Imag Coefficient Second Function";
  2686. static char recoefsqr[] = "Real Coefficient Square Term";
  2687. static char imcoefsqr[] = "Imag Coefficient Square Term";
  2688. static char recoef2nd[] = "Real Coefficient Second Term";
  2689. static char imcoef2nd[] = "Imag Coefficient Second Term";
  2690.  
  2691. /* KAM Torus */
  2692. static char kamangle[] = "Angle (radians)";
  2693. static char kamstep[] =  "Step size";
  2694. static char kamstop[] =  "Stop value";
  2695. static char pointsperorbit[] = "Points per orbit";
  2696.  
  2697. /* Newtbasin */
  2698. static char stripes[] = "Enter non-zero value for stripes";
  2699.  
  2700. /* bailout defines */
  2701. #define FTRIGBAILOUT 2500.0
  2702. #define LTRIGBAILOUT   64.0
  2703. #define STDBAILOUT        4.0
  2704. #define NOBAILOUT    0.0
  2705.  
  2706. struct fractalspecificstuff far fractalspecific[] =
  2707. {
  2708.    /*
  2709.      fractal name, parameter text strings, parameter values, flags,
  2710.      xmin  xmax  ymin  ymax int tojulia   tomandel tofloat  symmetry
  2711.    |------|-----|-----|-----|--|--------|---------|--------|---------|
  2712.      orbit fnct     per_pixel fnct  per_image fnct  calctype fcnt    bailout
  2713.    |---------------|---------------|---------------|----------------|-------|
  2714.    */
  2715.  
  2716.    "mandel",      realz0, imagz0,"","",0,0,0,0, WINFRAC,
  2717.    -2.5,  1.5, -1.5,  1.5, 1, JULIA,     NOFRACTAL, MANDELFP, XAXIS_NOPARM,
  2718.    JuliaFractal,  mandel_per_pixel,MandelSetup,    calcmand,        STDBAILOUT,
  2719.  
  2720.    "julia",       realparm, imagparm,"","",0.3,0.6,0,0, WINFRAC,
  2721.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, MANDEL, JULIAFP,  ORIGIN,
  2722.    JuliaFractal,   julia_per_pixel, JuliaSetup,    calcmand,        STDBAILOUT,
  2723.  
  2724.    "*newtbasin",   newtdegree,"", "","",3,0,0,0, 0,
  2725.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, MPNEWTBASIN,   NOSYM,
  2726.    NewtonFractal2, otherjuliafp_per_pixel,  NewtonSetup, StandardFractal,NOBAILOUT,
  2727.  
  2728.    "lambda",      realparm, imagparm,"","",0.85,0.6,0,0, WINFRAC,
  2729.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, MANDELLAMBDA, LAMBDAFP,  NOSYM,
  2730.    LambdaFractal,   julia_per_pixel, JulialongSetup,  StandardFractal,STDBAILOUT,
  2731.  
  2732.    "*mandel",    realz0, imagz0,"","",0,0,0,0, 0,
  2733.    -2.5,  1.5, -1.5,  1.5, 0, JULIAFP,     NOFRACTAL, MANDEL,  XAXIS_NOPARM,
  2734.    JuliafpFractal,mandelfp_per_pixel, MandelfpSetup,StandardFractal,STDBAILOUT,
  2735.  
  2736.    "*newton",      newtdegree,stripes, "","",3,0,0,0, 0,
  2737.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, MPNEWTON,    XAXIS,
  2738.    NewtonFractal2, otherjuliafp_per_pixel,  NewtonSetup, StandardFractal,NOBAILOUT,
  2739.  
  2740.    "*julia",     realparm, imagparm,"","",0.3,0.6,0,0, 0,
  2741.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, MANDELFP, JULIA,  ORIGIN,
  2742.    JuliafpFractal, juliafp_per_pixel,  JuliafpSetup,StandardFractal,STDBAILOUT,
  2743.  
  2744.    "plasma",      "Graininess Factor (.1 to 50, default is 2)","","","",2,0,0,0,
  2745.    NOZOOM+NOGUESS+NOTRACE+NORESUME+WINFRAC,
  2746.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  2747.    NULL,       NULL,   StandaloneSetup,     plasma,      NOBAILOUT,
  2748.  
  2749.    "*mandelfn",  realz0, imagz0,"","",0,0,0,0,TRIG1+WINFRAC,
  2750.    -8.0,  8.0, -6.0,  6.0, 0, LAMBDATRIGFP,NOFRACTAL, MANDELTRIG, XYAXIS_NOPARM,
  2751.    LambdaTrigfpFractal,othermandelfp_per_pixel,MandelTrigSetup,StandardFractal,FTRIGBAILOUT,
  2752.  
  2753.    "*manowar",    realz0, imagz0,"","",0,0,0,0, 0,
  2754.    -2.5,  1.5, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, MANOWAR,  XAXIS_NOPARM,
  2755.    ManOWarfpFractal,mandelfp_per_pixel, MandelfpSetup,StandardFractal,STDBAILOUT,
  2756.  
  2757.    "manowar",    realz0, imagz0,"","",0,0,0,0, WINFRAC,
  2758.    -2.5,  1.5, -1.5,  1.5, 1, NOFRACTAL, NOFRACTAL, MANOWARFP,    XAXIS_NOPARM,
  2759.    ManOWarFractal,mandel_per_pixel, MandellongSetup,StandardFractal,STDBAILOUT,
  2760.  
  2761.    "test",        "(testpt Param #1)","(testpt param #2)","(testpt param #3)", "(testpt param #4)",0,0,0,0, WINFRAC,
  2762.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  2763.    NULL,      NULL,         StandaloneSetup, test,    STDBAILOUT,
  2764.  
  2765.   "sierpinski",  "","","","",0,0,0,0, WINFRAC,
  2766.    -0.9,  1.7, -0.9,  1.7, 1, NOFRACTAL, NOFRACTAL, SIERPINSKIFP,   NOSYM,
  2767.    SierpinskiFractal,long_julia_per_pixel, SierpinskiSetup,StandardFractal,127.0,
  2768.  
  2769.   "barnsleym1",  realz0, imagz0,"","",0,0,0,0, WINFRAC,
  2770.    -2.0,  2.0, -1.5,  1.5, 1, BARNSLEYJ1,NOFRACTAL, BARNSLEYM1FP,  XYAXIS_NOPARM,
  2771.    Barnsley1Fractal,long_mandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
  2772.  
  2773.   "barnsleyj1",  realparm, imagparm,"","",0.6,1.1,0,0, WINFRAC,
  2774.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, BARNSLEYM1, BARNSLEYJ1FP,  ORIGIN,
  2775.    Barnsley1Fractal,long_julia_per_pixel,JulialongSetup,StandardFractal,STDBAILOUT,
  2776.  
  2777.    "barnsleym2",  realz0, imagz0,"","",0,0,0,0, WINFRAC,
  2778.    -2.0,  2.0, -1.5,  1.5, 1, BARNSLEYJ2,NOFRACTAL, BARNSLEYM2FP,  YAXIS_NOPARM,
  2779.    Barnsley2Fractal,long_mandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
  2780.  
  2781.    "barnsleyj2",  realparm, imagparm,"","",0.6,1.1,0,0, WINFRAC,
  2782.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, BARNSLEYM2, BARNSLEYJ2FP,  ORIGIN,
  2783.    Barnsley2Fractal,long_julia_per_pixel,JulialongSetup,StandardFractal,STDBAILOUT,
  2784.  
  2785.    "sqr(fn)", "","","","",0,0,0,0,TRIG1+WINFRAC,
  2786.    -4.0,  4.0, -3.0,  3.0, 16, NOFRACTAL, NOFRACTAL, SQRTRIGFP,XYAXIS,
  2787.    SqrTrigFractal,   long_julia_per_pixel, SqrTrigSetup,  StandardFractal,LTRIGBAILOUT,
  2788.  
  2789.    "*sqr(fn)", "","","","",0,0,0,0,TRIG1+WINFRAC,
  2790.    -4.0,  4.0, -3.0,  3.0, 0, NOFRACTAL, NOFRACTAL, SQRTRIG,XYAXIS,
  2791.    SqrTrigfpFractal,   otherjuliafp_per_pixel, SqrTrigSetup,  StandardFractal,LTRIGBAILOUT,
  2792.  
  2793.    "fn+fn", recoeftrg1, imcoeftrg1,recoeftrg2, imcoeftrg2,1,0,1,0,TRIG2+WINFRAC,
  2794.    -4.0,  4.0, -3.0,  3.0, 16, NOFRACTAL, NOFRACTAL, TRIGPLUSTRIGFP,XAXIS,
  2795.    TrigPlusTrigFractal,   long_julia_per_pixel, TrigPlusTriglongSetup,    StandardFractal,LTRIGBAILOUT,
  2796.  
  2797.    "mandellambda",realz0, imagz0,"","",0,0,0,0, WINFRAC,
  2798.    -3.0,  5.0, -3.0,  3.0, 1, LAMBDA,     NOFRACTAL, MANDELLAMBDAFP,  XAXIS_NOPARM,
  2799.    LambdaFractal,mandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
  2800.  
  2801.    "marksmandel", realz0, imagz0, exponent,"",0,0,1,0, WINFRAC,
  2802.    -2.0,  2.0, -1.5,  1.5, 1, MARKSJULIA, NOFRACTAL, NOFRACTAL,  NOSYM,
  2803.    MarksLambdaFractal,marksmandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
  2804.  
  2805.    "marksjulia", realparm, imagparm, exponent,"",0.1,0.9,0,0, WINFRAC,
  2806.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, MARKSMANDEL, NOFRACTAL,   ORIGIN,
  2807.    MarksLambdaFractal,julia_per_pixel,MarksJuliaSetup,StandardFractal,STDBAILOUT,
  2808.  
  2809.    "unity",       "","","","",0,0,0,0, WINFRAC,
  2810.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, NOFRACTAL, UNITYFP,   XYAXIS,
  2811.    UnityFractal, long_julia_per_pixel,UnitySetup,StandardFractal,NOBAILOUT,
  2812.  
  2813.    "mandel4",      realz0, imagz0,"","",0,0,0,0, WINFRAC,
  2814.    -2.0,  2.0, -1.5,  1.5, 1, JULIA4,      NOFRACTAL, NOFRACTAL,  XAXIS_NOPARM,
  2815.    Mandel4Fractal,  mandel_per_pixel, MandellongSetup, StandardFractal,  STDBAILOUT,
  2816.  
  2817.    "julia4",       realparm, imagparm,"","",0.6,0.55,0,0, WINFRAC,
  2818.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, MANDEL4, NOFRACTAL, ORIGIN,
  2819.    Mandel4Fractal,   julia_per_pixel, JulialongSetup,StandardFractal,     STDBAILOUT,
  2820.  
  2821.    "ifs",        "","","","",0,0,0,0, NOGUESS+NOTRACE+NORESUME+WINFRAC,
  2822.    -8.0,  8.0, -1.0, 11.0, 16, NOFRACTAL, NOFRACTAL, NOFRACTAL,  NOSYM,
  2823.    NULL,      NULL,         StandaloneSetup, ifs,    NOBAILOUT,
  2824.  
  2825.    "ifs3d",        "","","","",0,0,0,0, NOGUESS+NOTRACE+NORESUME+WINFRAC,
  2826.    -11.0,  11.0, -11.0, 11.0, 16, NOFRACTAL, NOFRACTAL, NOFRACTAL,   NOSYM,
  2827.    NULL,      NULL,      StandaloneSetup, ifs3d,    NOBAILOUT,
  2828.  
  2829.    "barnsleym3",  realz0, imagz0,"","",0,0,0,0, WINFRAC,
  2830.    -2.0,  2.0, -1.5,  1.5, 1, BARNSLEYJ3,NOFRACTAL, BARNSLEYM3FP,  XAXIS_NOPARM,
  2831.    Barnsley3Fractal,long_mandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
  2832.  
  2833.    "barnsleyj3",  realparm, imagparm,"","",0.1,0.36,0,0, WINFRAC,
  2834.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, BARNSLEYM3, BARNSLEYJ3FP,  XAXIS,
  2835.    Barnsley3Fractal,long_julia_per_pixel,JulialongSetup,StandardFractal,STDBAILOUT,
  2836.  
  2837.    "fn(z*z)", "","","","",0,0,0,0,TRIG1+WINFRAC,
  2838.    -4.0,  4.0, -3.0,  3.0, 16, NOFRACTAL, NOFRACTAL, TRIGSQRFP,XYAXIS,
  2839.    TrigZsqrdFractal,   julia_per_pixel, JulialongSetup,  StandardFractal,STDBAILOUT,
  2840.  
  2841.    "*fn(z*z)", "","","","",0,0,0,0,TRIG1+WINFRAC,
  2842.    -4.0,  4.0, -3.0,  3.0, 0, NOFRACTAL, NOFRACTAL, TRIGSQR,XYAXIS,
  2843.    TrigZsqrdfpFractal,     juliafp_per_pixel, JuliafpSetup,  StandardFractal,STDBAILOUT,
  2844.  
  2845.    "*bifurcation",     "", "","","",0,0,0,0, NOGUESS+NOTRACE+NOROTATE,
  2846.    1.9,  3.0, 0,  1.34, 0, NOFRACTAL, NOFRACTAL, LBIFURCATION, NOSYM,
  2847.    BifurcVerhulst, NULL, StandaloneSetup, Bifurcation, NOBAILOUT,
  2848.  
  2849.    "*fn+fn", recoeftrg1, imcoeftrg1,recoeftrg2, imcoeftrg2,1,0,1,0,TRIG2+WINFRAC,
  2850.    -4.0,  4.0, -3.0,  3.0, 0, NOFRACTAL, NOFRACTAL, TRIGPLUSTRIG,XAXIS,
  2851.    TrigPlusTrigfpFractal, otherjuliafp_per_pixel, TrigPlusTrigfpSetup,    StandardFractal,LTRIGBAILOUT,
  2852.  
  2853.    "fn*fn", "","","","",0,0,0,0,TRIG2+WINFRAC,
  2854.    -4.0,  4.0, -3.0,  3.0, 16, NOFRACTAL, NOFRACTAL, TRIGXTRIGFP,PI,
  2855.    TrigXTrigFractal, long_julia_per_pixel, FnXFnSetup,    StandardFractal,LTRIGBAILOUT,
  2856.  
  2857.    "*fn*fn", "","","","",0,0,0,0,TRIG2+WINFRAC,
  2858.    -4.0,  4.0, -3.0,  3.0, 0, NOFRACTAL, NOFRACTAL, TRIGXTRIG,PI,
  2859.    TrigXTrigfpFractal, otherjuliafp_per_pixel, FnXFnSetup,  StandardFractal,LTRIGBAILOUT,
  2860.  
  2861.    "sqr(1/fn)","","","","",0,0,0,0,TRIG1+WINFRAC,
  2862.    -4.0,  4.0, -3.0,  3.0, 16, NOFRACTAL, NOFRACTAL, SQR1OVERTRIGFP,NOSYM,
  2863.    Sqr1overTrigFractal, long_julia_per_pixel, SqrTrigSetup,  StandardFractal,LTRIGBAILOUT,
  2864.  
  2865.    "*sqr(1/fn)","","","","",0,0,0,0,TRIG1+WINFRAC,
  2866.    -4.0,  4.0, -3.0,  3.0, 0, NOFRACTAL, NOFRACTAL, SQR1OVERTRIG,NOSYM,
  2867.    Sqr1overTrigfpFractal, otherjuliafp_per_pixel, SqrTrigSetup,  StandardFractal,LTRIGBAILOUT,
  2868.  
  2869.    "fn*z+z",recoeftrg1, imcoeftrg1, recoef2nd,imcoef2nd,1,0,1,0,TRIG1+WINFRAC,
  2870.    -4.0,  4.0, -3.0,  3.0, 1, NOFRACTAL, NOFRACTAL, ZXTRIGPLUSZFP,XAXIS,
  2871.    ZXTrigPlusZFractal,julia_per_pixel,ZXTrigPlusZSetup,  StandardFractal,LTRIGBAILOUT,
  2872.  
  2873.    "*fn*z+z",recoeftrg1, imcoeftrg2, recoef2nd,imcoef2nd,1,0,1,0,TRIG1+WINFRAC,
  2874.    -4.0,  4.0, -3.0,  3.0, 0, NOFRACTAL, NOFRACTAL, ZXTRIGPLUSZ,XAXIS,
  2875.    ZXTrigPlusZfpFractal,   juliafp_per_pixel, ZXTrigPlusZSetup,  StandardFractal,LTRIGBAILOUT,
  2876.  
  2877.    "*kamtorus",kamangle,kamstep,kamstop,pointsperorbit,1.3,.05,1.5,150, NOGUESS+NOTRACE+INFCALC,
  2878.    -1.0,  1.0, -.75, .75, 0, NOFRACTAL, NOFRACTAL, KAM, NOSYM,
  2879.    kamtorusfloatorbit, NULL,         orbit3dfloatsetup, orbit2dfloat,     NOBAILOUT,
  2880.  
  2881.    "kamtorus",kamangle,kamstep,kamstop,pointsperorbit,1.3,.05,1.5,150, NOGUESS+NOTRACE+INFCALC+WINFRAC,
  2882.    -1.0,  1.0, -.75, .75,16, NOFRACTAL, NOFRACTAL, KAMFP,    NOSYM,
  2883.    kamtoruslongorbit, NULL,         orbit3dlongsetup, orbit2dlong,     NOBAILOUT,
  2884.  
  2885.    "*kamtorus3d",kamangle,kamstep,kamstop,pointsperorbit,1.3,.05,1.5,150, NOGUESS+NOTRACE+INFCALC,
  2886.    -3.0,  3.0, -1, 3.5, 0, NOFRACTAL, NOFRACTAL, KAM3D,       NOSYM,
  2887.    kamtorusfloatorbit, NULL,         orbit3dfloatsetup, orbit3dfloat,     NOBAILOUT,
  2888.  
  2889.    "kamtorus3d",kamangle,kamstep,kamstop,pointsperorbit,1.3,.05,1.5,150, NOGUESS+NOTRACE+INFCALC+WINFRAC,
  2890.    -3.0,  3.0, -1, 3.5,16, NOFRACTAL, NOFRACTAL, KAM3DFP,     NOSYM,
  2891.    kamtoruslongorbit, NULL,         orbit3dlongsetup, orbit3dlong,     NOBAILOUT,
  2892.  
  2893.    "lambdafn",      realparm, imagparm,"","",1.0,0.4,0,0,TRIG1+WINFRAC,
  2894.    -4.0,  4.0, -3.0,  3.0, 16, NOFRACTAL, MANDELTRIG, LAMBDATRIGFP,PI_SYM,
  2895.    LambdaTrigFractal,long_julia_per_pixel, LambdaTrigSetup,    StandardFractal,LTRIGBAILOUT,
  2896.  
  2897.    "manfn+zsqrd",      realz0, imagz0,"","",0,0,0,0, TRIG1+WINFRAC,
  2898.    -2.5,  1.5, -1.5,  1.5, 16, LJULTRIGPLUSZSQRD,  NOFRACTAL, FPMANTRIGPLUSZSQRD, XAXIS_NOPARM,
  2899.    TrigPlusZsquaredFractal,mandel_per_pixel,MandellongSetup,StandardFractal, STDBAILOUT,
  2900.  
  2901.    "julfn+zsqrd",       realparm, imagparm,"","",-0.5,0.5,0,0, TRIG1+WINFRAC,
  2902.    -2.0,  2.0, -1.5,  1.5, 16, NOFRACTAL, LMANTRIGPLUSZSQRD, FPJULTRIGPLUSZSQRD,    NOSYM,
  2903.    TrigPlusZsquaredFractal,julia_per_pixel, JuliafnPlusZsqrdSetup,StandardFractal, STDBAILOUT,
  2904.  
  2905.    "*manfn+zsqrd",    realz0, imagz0,"","",0,0,0,0, TRIG1+WINFRAC,
  2906.    -2.5,  1.5, -1.5,  1.5, 0, FPJULTRIGPLUSZSQRD,   NOFRACTAL, LMANTRIGPLUSZSQRD, XAXIS_NOPARM,
  2907.    TrigPlusZsquaredfpFractal,mandelfp_per_pixel, MandelfpSetup,StandardFractal, STDBAILOUT,
  2908.  
  2909.    "*julfn+zsqrd",     realparm, imagparm,"","",-0.5,0.5,0,0, TRIG1+WINFRAC,
  2910.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, FPMANTRIGPLUSZSQRD, LJULTRIGPLUSZSQRD, NOSYM,
  2911.    TrigPlusZsquaredfpFractal, juliafp_per_pixel,  JuliafnPlusZsqrdSetup,StandardFractal, STDBAILOUT,
  2912.  
  2913.    "*lambdafn",  realparm, imagparm,"","",1.0,0.4,0,0,TRIG1+WINFRAC,
  2914.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, MANDELTRIGFP, LAMBDATRIG, PI_SYM,
  2915.    LambdaTrigfpFractal,otherjuliafp_per_pixel,LambdaTrigSetup,StandardFractal,FTRIGBAILOUT,
  2916.  
  2917.    "mandelfn",realz0, imagz0,"","",0,0,0,0,TRIG1+WINFRAC,
  2918.    -8.0,  8.0, -6.0,  6.0, 16, LAMBDATRIG, NOFRACTAL, MANDELTRIGFP, XYAXIS_NOPARM,
  2919.    LambdaTrigFractal,long_mandel_per_pixel,MandelTrigSetup,StandardFractal,LTRIGBAILOUT,
  2920.  
  2921.    "manzpower", realz0, imagz0, exponent,"",0,0,2,0, WINFRAC,
  2922.    -2.0,  2.0, -1.5,  1.5, 1, LJULIAZPOWER, NOFRACTAL, FPMANDELZPOWER,    XAXIS,
  2923.    longZpowerFractal,long_mandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
  2924.  
  2925.    "julzpower", realparm, imagparm, exponent,"",0.3,0.6,2,0, WINFRAC,
  2926.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, LMANDELZPOWER, FPJULIAZPOWER,     ORIGIN,
  2927.    longZpowerFractal,long_julia_per_pixel,JulialongSetup,StandardFractal,STDBAILOUT,
  2928.  
  2929.    "*manzpower",    realz0, imagz0, exponent,"",0,0,2,0, 0,
  2930.    -2.5,  1.5, -1.5,  1.5, 0, FPJULIAZPOWER,   NOFRACTAL, LMANDELZPOWER,  XAXIS_NOPARM,
  2931.    floatZpowerFractal,othermandelfp_per_pixel, MandelfpSetup,StandardFractal,STDBAILOUT,
  2932.  
  2933.    "*julzpower",     realparm, imagparm, exponent,"",0.3,0.6,2,0, 0,
  2934.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, FPMANDELZPOWER, LJULIAZPOWER,    ORIGIN,
  2935.    floatZpowerFractal, otherjuliafp_per_pixel,    JuliafpSetup,StandardFractal,STDBAILOUT,
  2936.  
  2937.    "manzzpwr",    realz0, imagz0, exponent,"",0,0,2,0, WINFRAC,
  2938.    -2.5,  1.5, -1.5,  1.5, 0, FPJULZTOZPLUSZPWR,   NOFRACTAL, NOFRACTAL,  XAXIS_NOPARM,
  2939.    floatZtozPluszpwrFractal,othermandelfp_per_pixel, MandelfpSetup,StandardFractal,STDBAILOUT,
  2940.  
  2941.    "julzzpwr",     realparm, imagparm, exponent,"",-0.3,0.3,2,0, WINFRAC,
  2942.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, FPMANZTOZPLUSZPWR, NOFRACTAL,    NOSYM,
  2943.    floatZtozPluszpwrFractal, otherjuliafp_per_pixel,  JuliafpSetup,StandardFractal,STDBAILOUT,
  2944.  
  2945.    "manfn+exp",realz0, imagz0,"","",0,0,0,0, TRIG1+WINFRAC,
  2946.    -8.0,  8.0, -6.0,  6.0, 16, LJULTRIGPLUSEXP,    NOFRACTAL,  FPMANTRIGPLUSEXP, XAXIS_NOPARM,
  2947.    LongTrigPlusExponentFractal,long_mandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
  2948.  
  2949.    "julfn+exp",      realparm, imagparm,"","",0,0,0,0, TRIG1+WINFRAC,
  2950.    -4.0,  4.0, -3.0,  3.0, 16, NOFRACTAL, LMANTRIGPLUSEXP,FPJULTRIGPLUSEXP, NOSYM,
  2951.    LongTrigPlusExponentFractal,   long_julia_per_pixel, JulialongSetup,  StandardFractal,STDBAILOUT,
  2952.  
  2953.    "*manfn+exp",   realz0, imagz0,"","",0,0,0,0, TRIG1+WINFRAC,
  2954.    -8.0,  8.0, -6.0,  6.0, 0, FPJULTRIGPLUSEXP, NOFRACTAL, LMANTRIGPLUSEXP,   XAXIS_NOPARM,
  2955.    FloatTrigPlusExponentFractal,othermandelfp_per_pixel,MandelfpSetup,StandardFractal,STDBAILOUT,
  2956.  
  2957.    "*julfn+exp",   realparm, imagparm,"","",0,0,0,0, TRIG1+WINFRAC,
  2958.    -4.0,  4.0, -3.0,  3.0, 0, NOFRACTAL, FPMANTRIGPLUSEXP, LJULTRIGPLUSEXP,   NOSYM,
  2959.    FloatTrigPlusExponentFractal,otherjuliafp_per_pixel,JuliafpSetup,StandardFractal,STDBAILOUT,
  2960.  
  2961.    "*popcorn", "", "", "","",0,0,0,0, NOGUESS+NOTRACE+WINFRAC,
  2962.    -3.0,  3.0, -2.2,  2.2, 0, NOFRACTAL, NOFRACTAL, LPOPCORN,  NOPLOT,
  2963.    PopcornFractal, otherjuliafp_per_pixel,  JuliafpSetup,  popcorn,STDBAILOUT,
  2964.  
  2965.    "popcorn", "", "", "","",0,0,0,0, NOGUESS+NOTRACE+WINFRAC,
  2966.    -3.0,  3.0, -2.2,  2.2, 16, NOFRACTAL, NOFRACTAL, FPPOPCORN,  NOPLOT,
  2967.    LPopcornFractal,   long_julia_per_pixel, JulialongSetup,popcorn,STDBAILOUT,
  2968.  
  2969.    "*lorenz",timestep,"a","b", "c",.02,5,15,1, NOGUESS+NOTRACE+INFCALC,
  2970.    -15,  15, 0, 30, 0, NOFRACTAL, NOFRACTAL, LLORENZ,    NOSYM,
  2971.    lorenz3dfloatorbit, NULL,         orbit3dfloatsetup, orbit2dfloat,     NOBAILOUT,
  2972.  
  2973.    "lorenz",timestep,"a","b", "c",.02,5,15,1, NOGUESS+NOTRACE+INFCALC+WINFRAC,
  2974.    -15,  15, 0, 30, 16, NOFRACTAL, NOFRACTAL, FPLORENZ,   NOSYM,
  2975.    lorenz3dlongorbit, NULL,        orbit3dlongsetup, orbit2dlong,    NOBAILOUT,
  2976.  
  2977.    "lorenz3d",timestep,"a","b", "c",.02,5,15,1, NOGUESS+NOTRACE+NORESUME+WINFRAC,
  2978.    -30.0,  30.0,  -30.0,   30.0, 16, NOFRACTAL, NOFRACTAL, FPLORENZ3D,     NOSYM,
  2979.    lorenz3dlongorbit, NULL,        orbit3dlongsetup, orbit3dlong,    NOBAILOUT,
  2980.  
  2981.    "newton",      newtdegree,"", "","",3,0,0,0, WINFRAC,
  2982.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, NEWTON,   XAXIS,
  2983.    MPCNewtonFractal, MPCjulia_per_pixel,  NewtonSetup, StandardFractal,NOBAILOUT,
  2984.  
  2985.    "newtbasin",      newtdegree,stripes, "","",0,0,0,0, WINFRAC,
  2986.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, NEWTBASIN,     NOSYM,
  2987.    MPCNewtonFractal, MPCjulia_per_pixel,  NewtonSetup, StandardFractal,NOBAILOUT,
  2988.  
  2989.    "complexnewton", realdegree, imagdegree, realroot, imagroot,3,0,1,0, WINFRAC,
  2990.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  2991.    ComplexNewton, otherjuliafp_per_pixel,  ComplexNewtonSetup, StandardFractal,NOBAILOUT,
  2992.  
  2993.    "complexbasin", realdegree, imagdegree, realroot, imagroot,3,0,1,0, WINFRAC,
  2994.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  2995.    ComplexBasin, otherjuliafp_per_pixel,  ComplexNewtonSetup,  StandardFractal, NOBAILOUT,
  2996.  
  2997.    "cmplxmarksmand", realz0, imagz0, realdegree, imagdegree,0,0,1,0, WINFRAC,
  2998.    -2.0,  2.0, -1.5,  1.5, 0, COMPLEXMARKSJUL, NOFRACTAL, NOFRACTAL,   NOSYM,
  2999.    MarksCplxMand, MarksCplxMandperp, MandelfpSetup, StandardFractal, STDBAILOUT,
  3000.  
  3001.    "cmplxmarksjul", realparm, imagparm, realdegree, imagdegree,0.3,0.6,1,0, WINFRAC,
  3002.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, COMPLEXMARKSMAND, NOFRACTAL,    NOSYM,
  3003.    MarksCplxMand, juliafp_per_pixel, JuliafpSetup, StandardFractal, STDBAILOUT,
  3004.  
  3005.    "formula", p1real, p1imag, p2real, p2imag, 0,0,0,0, WINFRAC,
  3006.    -2.0, 2.0, -1.5, 1.5, 1, NOFRACTAL, NOFRACTAL, FFORMULA, SETUP_SYM,
  3007.    Formula, form_per_pixel, intFormulaSetup, StandardFractal, 0,
  3008.  
  3009.    "*formula", p1real, p1imag, p2real, p2imag, 0,0,0,0, WINFRAC,
  3010.    -2.0, 2.0, -1.5, 1.5, 0, NOFRACTAL, NOFRACTAL, FORMULA, SETUP_SYM,
  3011.    Formula, form_per_pixel, fpFormulaSetup, StandardFractal, 0,
  3012.  
  3013.   "*sierpinski",  "","","","",0,0,0,0, 0,
  3014.    -0.9,  1.7, -0.9,  1.7, 0, NOFRACTAL, NOFRACTAL, SIERPINSKI,   NOSYM,
  3015.    SierpinskiFPFractal, otherjuliafp_per_pixel, SierpinskiFPSetup,StandardFractal,127.0,
  3016.  
  3017.    "*lambda",      realparm, imagparm,"","",0.85,0.6,0,0, 0,
  3018.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, MANDELLAMBDAFP, LAMBDA,  NOSYM,
  3019.    LambdaFPFractal,   juliafp_per_pixel, JuliafpSetup,    StandardFractal,STDBAILOUT,
  3020.  
  3021.   "*barnsleym1",  realz0, imagz0,"","",0,0,0,0, 0,
  3022.    -2.0,  2.0, -1.5,  1.5, 0, BARNSLEYJ1FP,NOFRACTAL, BARNSLEYM1,  XYAXIS_NOPARM,
  3023.    Barnsley1FPFractal, othermandelfp_per_pixel,MandelfpSetup,StandardFractal,STDBAILOUT,
  3024.  
  3025.   "*barnsleyj1",  realparm, imagparm,"","",0.6,1.1,0,0, 0,
  3026.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, BARNSLEYM1FP, BARNSLEYJ1,  ORIGIN,
  3027.    Barnsley1FPFractal, otherjuliafp_per_pixel,JuliafpSetup,StandardFractal,STDBAILOUT,
  3028.  
  3029.    "*barnsleym2",  realz0, imagz0,"","",0,0,0,0, 0,
  3030.    -2.0,  2.0, -1.5,  1.5, 0, BARNSLEYJ2FP,NOFRACTAL, BARNSLEYM2,  YAXIS_NOPARM,
  3031.    Barnsley2FPFractal,othermandelfp_per_pixel,MandelfpSetup,StandardFractal,STDBAILOUT,
  3032.  
  3033.    "*barnsleyj2",  realparm, imagparm,"","",0.6,1.1,0,0, 0,
  3034.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, BARNSLEYM2FP, BARNSLEYJ2,  ORIGIN,
  3035.    Barnsley2FPFractal,otherjuliafp_per_pixel,JuliafpSetup,StandardFractal,STDBAILOUT,
  3036.  
  3037.    "*barnsleym3",  realz0, imagz0,"","",0,0,0,0, 0,
  3038.    -2.0,  2.0, -1.5,  1.5, 0, BARNSLEYJ3FP, NOFRACTAL, BARNSLEYM3,  XAXIS_NOPARM,
  3039.    Barnsley3FPFractal,othermandelfp_per_pixel,MandelfpSetup,StandardFractal,STDBAILOUT,
  3040.  
  3041.    "*barnsleyj3",  realparm, imagparm,"","",0.6,1.1,0,0, 0,
  3042.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, BARNSLEYM3FP, BARNSLEYJ3,  XAXIS,
  3043.    Barnsley3FPFractal,otherjuliafp_per_pixel,JuliafpSetup,StandardFractal,STDBAILOUT,
  3044.  
  3045.    "*mandellambda",realz0, imagz0,"","",0,0,0,0, 0,
  3046.    -3.0,  5.0, -3.0,  3.0, 0, LAMBDAFP, NOFRACTAL, MANDELLAMBDA,  XAXIS_NOPARM,
  3047.    LambdaFPFractal,mandelfp_per_pixel,MandelfpSetup,StandardFractal,STDBAILOUT,
  3048.  
  3049.    "julibrot", "","","","", -.83, -.83, .25, -.25, NOGUESS+NOTRACE+NOROTATE+NORESUME+WINFRAC,
  3050.    -2.0, 2.0, -1.5, 1.5, 1, NOFRACTAL, NOFRACTAL, NOFRACTAL, NOSYM,
  3051.    JuliaFractal, jb_per_pixel, JulibrotSetup, Std4dFractal, STDBAILOUT,
  3052.  
  3053.    "*lorenz3d",timestep,"a","b", "c",.02,5,15,1, NOGUESS+NOTRACE+NORESUME,
  3054.    -30.0,  30.0,  -30.0,   30.0, 0, NOFRACTAL, NOFRACTAL, LLORENZ3D,   NOSYM,
  3055.    lorenz3dfloatorbit, NULL,         orbit3dfloatsetup, orbit3dfloat,     NOBAILOUT,
  3056.  
  3057.    "rossler3d",timestep,"a","b", "c",.04, .2, .2, 5.7, NOGUESS+NOTRACE+NORESUME+WINFRAC,
  3058.    -30.0,  30.0,  -20.0,   40.0, 16, NOFRACTAL, NOFRACTAL, FPROSSLER,    NOSYM,
  3059.    rosslerlongorbit, NULL,       orbit3dlongsetup, orbit3dlong,    NOBAILOUT,
  3060.  
  3061.    "*rossler3d",timestep,"a","b", "c",.04, .2, .2, 5.7, NOGUESS+NOTRACE+NORESUME,
  3062.    -30.0,  30.0,  -20.0,   40.0, 0, NOFRACTAL, NOFRACTAL, LROSSLER,   NOSYM,
  3063.    rosslerfloatorbit, NULL,        orbit3dfloatsetup, orbit3dfloat,    NOBAILOUT,
  3064.  
  3065.    "henon","a","b","","",1.4,.3,0,0, NOGUESS+NOTRACE+INFCALC+WINFRAC,
  3066.    -1.4,  1.4,    -.5,   .5, 16, NOFRACTAL, NOFRACTAL, FPHENON,    NOSYM,
  3067.    henonlongorbit, NULL,     orbit3dlongsetup, orbit2dlong,    NOBAILOUT,
  3068.  
  3069.    "*henon","a","b","","",1.4,.3,0,0, NOGUESS+NOTRACE+INFCALC,
  3070.    -1.4,  1.4,    -.5,   .5, 0, NOFRACTAL, NOFRACTAL, LHENON,   NOSYM,
  3071.    henonfloatorbit, NULL,      orbit3dfloatsetup, orbit2dfloat,    NOBAILOUT,
  3072.  
  3073.    "pickover","a","b","c","d",2.24,.43,-.65, -2.43, NOGUESS+NOTRACE+NORESUME+WINFRAC,
  3074.    -2.8,  2.8,    -2.0, 2.0, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  3075.    pickoverfloatorbit, NULL,         orbit3dfloatsetup, orbit3dfloat,     NOBAILOUT,
  3076.  
  3077.    "gingerbreadman","","","","",0,0,0,0, NOGUESS+NOTRACE+INFCALC+WINFRAC,
  3078.    -4.5,  8.5,    -4.5, 8.5, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  3079.    gingerbreadfloatorbit, NULL, orbit3dfloatsetup, orbit2dfloat,    NOBAILOUT,
  3080.  
  3081.    "diffusion",        "Border size","","", "",10,0,0,0,
  3082.    NOZOOM+NOGUESS+NOTRACE+NORESUME+WINFRAC,
  3083.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  3084.    NULL,   NULL,     StandaloneSetup, diffusion,    NOBAILOUT,
  3085.  
  3086.    "*unity",       "","","","",0,0,0,0, 0,
  3087.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, UNITY,   XYAXIS,
  3088.    UnityfpFractal, otherjuliafp_per_pixel,StandardSetup,StandardFractal,NOBAILOUT,
  3089.  
  3090.    "*spider",    realz0, imagz0,"","",0,0,0,0, 0,
  3091.    -2.5,  1.5, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, SPIDERFP+1,  XAXIS_NOPARM,
  3092.    SpiderfpFractal,mandelfp_per_pixel, MandelfpSetup,StandardFractal,STDBAILOUT,
  3093.  
  3094.    "spider",    realz0, imagz0,"","",0,0,0,0, WINFRAC,
  3095.    -2.5,  1.5, -1.5,  1.5, 1, NOFRACTAL, NOFRACTAL, SPIDERFP,  XAXIS_NOPARM,
  3096.    SpiderFractal,mandel_per_pixel, MandellongSetup,StandardFractal,STDBAILOUT,
  3097.  
  3098.    "tetrate",  realparm, imagparm,"","",0,0,0,0, WINFRAC,
  3099.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,    XAXIS,
  3100.    TetratefpFractal,othermandelfp_per_pixel,MandelfpSetup,StandardFractal,STDBAILOUT,
  3101.  
  3102.    "magnet1m", realz0, imagz0,"","",0,0,0,0,WINFRAC,
  3103.    -4.0, 4.0, -3.0, 3.0, 0, MAGNET1J,NOFRACTAL,NOFRACTAL, XAXIS_NOPARM,
  3104.    Magnet1Fractal,mandelfp_per_pixel,MandelfpSetup,StandardFractal,100.0,
  3105.  
  3106.    "magnet1j", realz0, imagz0,"","",0,0,0,0,WINFRAC,
  3107.    -8.0,  8.0, -6.0,  6.0, 0, NOFRACTAL,MAGNET1M,NOFRACTAL, XAXIS_NOIMAG,
  3108.    Magnet1Fractal,juliafp_per_pixel,JuliafpSetup,StandardFractal,100.0,
  3109.  
  3110.    "magnet2m", realz0, imagz0,"","",0,0,0,0,WINFRAC,
  3111.    -1.5,3.7, -1.95,1.95,   0, MAGNET2J,NOFRACTAL,NOFRACTAL, XAXIS_NOPARM,
  3112.    Magnet2Fractal,mandelfp_per_pixel,MandelfpSetup,StandardFractal,100.0,
  3113.  
  3114.    "magnet2j", realz0, imagz0,"","",0,0,0,0,WINFRAC,
  3115.    -8.0,  8.0, -6.0,  6.0, 0, NOFRACTAL,MAGNET2M,NOFRACTAL, XAXIS_NOIMAG,
  3116.    Magnet2Fractal,juliafp_per_pixel,JuliafpSetup,StandardFractal,100.0,
  3117.  
  3118.    "bifurcation",     "", "","","",0,0,0,0,NOGUESS+NOTRACE+NOROTATE+WINFRAC,
  3119.    1.9,  3.0, 0,  1.34, 1, NOFRACTAL, NOFRACTAL, BIFURCATION, NOSYM,
  3120.    LongBifurcVerhulst, NULL, StandaloneSetup, Bifurcation, NOBAILOUT,
  3121.  
  3122.    "biflambda",     "", "","","",0,0,0,0,NOGUESS+NOTRACE+NOROTATE+WINFRAC,
  3123.    -2.0, 4.0, -1.0, 2.0, 1, NOFRACTAL, NOFRACTAL, BIFLAMBDA,   NOSYM,
  3124.    LongBifurcLambda, NULL, StandaloneSetup, Bifurcation, NOBAILOUT,
  3125.  
  3126.    "*biflambda",     "", "","","",0,0,0,0,NOGUESS+NOTRACE+NOROTATE,
  3127.    -2.0, 4.0, -1.0, 2.0, 0, NOFRACTAL, NOFRACTAL, LBIFLAMBDA,  NOSYM,
  3128.    BifurcLambda, NULL, StandaloneSetup, Bifurcation, NOBAILOUT,
  3129.  
  3130.    "bif+sinpi",    "", "","","",0,0,0,0,NOGUESS+NOTRACE+NOROTATE+WINFRAC,
  3131.    0.275,1.45, 0.0, 2.0, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,   NOSYM,
  3132.    BifurcAddSinPi, NULL, StandaloneSetup, Bifurcation, NOBAILOUT,
  3133.  
  3134.    "bif=sinpi",     "", "","","",0,0,0,0,NOGUESS+NOTRACE+NOROTATE+WINFRAC,
  3135.    -2.5, 2.5, -3.5, 3.5, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,   NOSYM,
  3136.    BifurcSetSinPi, NULL, StandaloneSetup, Bifurcation, NOBAILOUT,
  3137.  
  3138.    "*popcornjul", "", "", "","",0,0,0,0, WINFRAC,
  3139.    -3.0,  3.0, -2.2,  2.2, 0, NOFRACTAL, NOFRACTAL, LPOPCORNJUL,  ORIGIN,
  3140.    PopcornFractal, otherjuliafp_per_pixel,  JuliafpSetup,StandardFractal,STDBAILOUT,
  3141.  
  3142.    "popcornjul", "", "", "","",0,0,0,0, WINFRAC,
  3143.    -3.0,  3.0, -2.2,  2.2, 16, NOFRACTAL, NOFRACTAL, FPPOPCORNJUL,  ORIGIN,
  3144.    LPopcornFractal,   long_julia_per_pixel, JulialongSetup,  StandardFractal,STDBAILOUT,
  3145.  
  3146.  
  3147.    NULL, NULL, NULL, NULL, NULL,0,0,0,0, 0, /* marks the END of the list */
  3148.    0,  0, 0,  0, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,   NOSYM,
  3149.    NULL, NULL, NULL, NULL,0
  3150. };
  3151.